import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    d = list(map(int, readline().split()))

    ans = 0

    for i in range(N):
        for j in range(i + 1, N):
            ans += d[i] * d[j]
    print(ans)


if __name__ == '__main__':
    main() import sys sys readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 INF = float('INF') INF float('INF') float 'INF' sys.setrecursionlimit(10 ** 5) sys.setrecursionlimit sys setrecursionlimit 10 ** 5 10 5 def main():
    N = int(readline())
    d = list(map(int, readline().split()))

    ans = 0

    for i in range(N):
        for j in range(i + 1, N):
            ans += d[i] * d[j]
    print(ans) main N = int(readline()) N int(readline()) int readline() readline d = list(map(int, readline().split())) d list(map(int, readline().split())) list map(int, readline().split()) map int readline().split() ().split () readline split ans = 0 ans 0 for i in range(N):
        for j in range(i + 1, N):
            ans += d[i] * d[j]
     i range(N) range N for j in range(i + 1, N):
            ans += d[i] * d[j]
     j range(i + 1, N) range i + 1 i 1 N ans += d[i] * d[j] ans d[i] * d[j] d[i] d i d[j] d j print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main readline = sys.stdin.readline sys.stdin.readline readline def main():
    N = int(readline())
    d = list(map(int, readline().split()))

    ans = 0

    for i in range(N):
        for j in range(i + 1, N):
            ans += d[i] * d[j]
    print(ans) def main():
    N = int(readline())
    d = list(map(int, readline().split()))

    ans = 0

    for i in range(N):
        for j in range(i + 1, N):
            ans += d[i] * d[j]
    print(ans) main MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD INF = float('INF') float('INF') INF
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    d = list(map(int, readline().split()))

    ans = 0

    for i in range(N):
        for j in range(i + 1, N):
            ans += d[i] * d[j]
    print(ans)


if __name__ == '__main__':
    main()
