from itertools import combinations

N = int(input())
takoyaki = list(int(x) for x in input().split())

life = 0

for c in combinations(range(N), 2):
    life += takoyaki[c[0]] * takoyaki[c[1]]

print(life) from itertools import combinations N = int(input()) N int(input()) int input() input takoyaki = list(int(x) for x in input().split()) takoyaki list(int(x) for x in input().split()) list int(x) int x life = 0 life 0 for c in combinations(range(N), 2):
    life += takoyaki[c[0]] * takoyaki[c[1]] c combinations(range(N), 2) combinations range(N) range N 2 life += takoyaki[c[0]] * takoyaki[c[1]] life takoyaki[c[0]] * takoyaki[c[1]] takoyaki[c[0]] takoyaki c[0] c 0 takoyaki[c[1]] takoyaki c[1] c 1 print(life) print life N = int(input()) int(input()) N life += takoyaki[c[0]] * takoyaki[c[1]] takoyaki[c[0]] * takoyaki[c[1]] life life = 0 0 life takoyaki = list(int(x) for x in input().split()) list(int(x) for x in input().split()) takoyaki
from itertools import combinations

N = int(input())
takoyaki = list(int(x) for x in input().split())

life = 0

for c in combinations(range(N), 2):
    life += takoyaki[c[0]] * takoyaki[c[1]]

print(life)
