"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") # 無限

n = int(input())
d = list(map(int,input().split()))


answer = 0
for i in range(n):
    temp=0
    for j in range(i+1,n):
        temp+=d[j]
    answer+=d[i]*temp

print(answer) """
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
""" import sys sys sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 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 inf = float("inf") inf float("inf") float "inf" 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 answer = 0 answer 0 for i in range(n):
    temp=0
    for j in range(i+1,n):
        temp+=d[j]
    answer+=d[i]*temp i range(n) range n temp=0 temp 0 for j in range(i+1,n):
        temp+=d[j]
     j range(i+1,n) range i+1 i 1 n temp+=d[j] temp d[j] d j answer+=d[i]*temp answer d[i]*temp d[i] d i temp print(answer) print answer input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input n = int(input()) int(input()) n answer = 0 0 answer answer+=d[i]*temp d[i]*temp answer d = list(map(int,input().split())) list(map(int,input().split())) d temp=0 0 temp inf = float("inf") float("inf") inf temp+=d[j] d[j] temp
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") # 無限

n = int(input())
d = list(map(int,input().split()))


answer = 0
for i in range(n):
    temp=0
    for j in range(i+1,n):
        temp+=d[j]
    answer+=d[i]*temp

print(answer)