import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
d = list(map(int, input().split()))
ans = (sum(d)**2 - sum(item**2 for item in d))//2
print(ans) import sys sys 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 sys.setrecursionlimit(max(1000, 10**9)) sys.setrecursionlimit sys setrecursionlimit max(1000, 10**9) max 1000 10**9 10 9 write = lambda x: sys.stdout.write(x+"\n") write lambda x: sys.stdout.write(x+"\n") sys.stdout.write(x+"\n") sys.stdout.write sys.stdout sys stdout write x+"\n" x "\n" x 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 = (sum(d)**2 - sum(item**2 for item in d))//2 ans (sum(d)**2 - sum(item**2 for item in d))//2 sum(d)**2 - sum(item**2 for item in d) sum(d)**2 sum(d) sum d 2 sum(item**2 for item in d) sum item**2 item 2 2 print(ans) print ans n = int(input()) int(input()) n write = lambda x: sys.stdout.write(x+"\n") lambda x: sys.stdout.write(x+"\n") write ans = (sum(d)**2 - sum(item**2 for item in d))//2 (sum(d)**2 - sum(item**2 for item in d))//2 ans input = lambda : sys.stdin.readline().rstrip() lambda : sys.stdin.readline().rstrip() input d = list(map(int, input().split())) list(map(int, input().split())) d
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
d = list(map(int, input().split()))
ans = (sum(d)**2 - sum(item**2 for item in d))//2
print(ans)