import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *D = map(int, read().split())

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

    print(ans)
    return


if __name__ == '__main__':
    main() import sys sys read = sys.stdin.read read sys.stdin.read sys.stdin sys stdin read readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline readlines = sys.stdin.readlines readlines sys.stdin.readlines sys.stdin sys stdin readlines sys.setrecursionlimit(10 ** 9) sys.setrecursionlimit sys setrecursionlimit 10 ** 9 10 9 INF = 1 << 60 INF 1 << 60 1 60 MOD = 1000000007 MOD 1000000007 def main():
    N, *D = map(int, read().split())

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

    print(ans)
    return main N, *D = map(int, read().split()) N map(int, read().split()) map int read().split() ().split () read split *D D 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 return if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main INF = 1 << 60 1 << 60 INF def main():
    N, *D = map(int, read().split())

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

    print(ans)
    return def main():
    N, *D = map(int, read().split())

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

    print(ans)
    return main readline = sys.stdin.readline sys.stdin.readline readline read = sys.stdin.read sys.stdin.read read readlines = sys.stdin.readlines sys.stdin.readlines readlines MOD = 1000000007 1000000007 MOD
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *D = map(int, read().split())

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

    print(ans)
    return


if __name__ == '__main__':
    main()
