import sys
import itertools
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    d = list(map(int,input().split()))
    ans = 0
    for i in itertools.combinations(d, 2):
        ans += i[0] * i[1]
    print(ans)

if __name__ == '__main__':
    main() import sys sys import itertools itertools input = lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def main():
    n = int(input())
    d = list(map(int,input().split()))
    ans = 0
    for i in itertools.combinations(d, 2):
        ans += i[0] * i[1]
    print(ans) main n = int(input()) n int(input()) int input() input d = list(map(int,input().split())) d list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans = 0 ans 0 for i in itertools.combinations(d, 2):
        ans += i[0] * i[1]
     i itertools.combinations(d, 2) itertools.combinations itertools combinations d 2 ans += i[0] * i[1] ans i[0] * i[1] i[0] i 0 i[1] i 1 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input def main():
    n = int(input())
    d = list(map(int,input().split()))
    ans = 0
    for i in itertools.combinations(d, 2):
        ans += i[0] * i[1]
    print(ans) def main():
    n = int(input())
    d = list(map(int,input().split()))
    ans = 0
    for i in itertools.combinations(d, 2):
        ans += i[0] * i[1]
    print(ans) main
import sys
import itertools
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    d = list(map(int,input().split()))
    ans = 0
    for i in itertools.combinations(d, 2):
        ans += i[0] * i[1]
    print(ans)

if __name__ == '__main__':
    main()