#!/usr/bin/env python3
import sys
import itertools

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    _ = int(readline())
    ds = map(int, readline().split())

    ans = 0
    for d1, d2 in itertools.combinations(ds, 2):
        ans += d1 * d2
    print(ans)

if __name__ == '__main__':
    main() import sys sys import itertools itertools read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline readlines = sys.stdin.buffer.readlines readlines sys.stdin.buffer.readlines sys.stdin.buffer sys.stdin sys stdin buffer readlines def main():
    _ = int(readline())
    ds = map(int, readline().split())

    ans = 0
    for d1, d2 in itertools.combinations(ds, 2):
        ans += d1 * d2
    print(ans) main _ = int(readline()) _ int(readline()) int readline() readline ds = map(int, readline().split()) ds map(int, readline().split()) map int readline().split() ().split () readline split ans = 0 ans 0 for d1, d2 in itertools.combinations(ds, 2):
        ans += d1 * d2
     d1 d2 itertools.combinations(ds, 2) itertools.combinations itertools combinations ds 2 ans += d1 * d2 ans d1 * d2 d1 d2 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main read = sys.stdin.buffer.read sys.stdin.buffer.read read readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline readlines = sys.stdin.buffer.readlines sys.stdin.buffer.readlines readlines def main():
    _ = int(readline())
    ds = map(int, readline().split())

    ans = 0
    for d1, d2 in itertools.combinations(ds, 2):
        ans += d1 * d2
    print(ans) def main():
    _ = int(readline())
    ds = map(int, readline().split())

    ans = 0
    for d1, d2 in itertools.combinations(ds, 2):
        ans += d1 * d2
    print(ans) main
#!/usr/bin/env python3
import sys
import itertools

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    _ = int(readline())
    ds = map(int, readline().split())

    ans = 0
    for d1, d2 in itertools.combinations(ds, 2):
        ans += d1 * d2
    print(ans)

if __name__ == '__main__':
    main()
