from itertools import combinations

def mapt(fn, *args):
    return tuple(map(fn, *args))

n = int(input())
d = mapt(int, input().split(" "))

print(sum(d[a]*d[b] for a, b in combinations(range(n), 2))) from itertools import combinations def mapt(fn, *args):
    return tuple(map(fn, *args)) mapt return tuple(map(fn, *args)) tuple(map(fn, *args)) tuple map(fn, *args) map fn *args args fn fn *args n = int(input()) n int(input()) int input() input d = mapt(int, input().split(" ")) d mapt(int, input().split(" ")) mapt int input().split(" ") ().split () input split " " print(sum(d[a]*d[b] for a, b in combinations(range(n), 2))) print sum(d[a]*d[b] for a, b in combinations(range(n), 2)) sum d[a]*d[b] d[a] d a d[b] d b def mapt(fn, *args):
    return tuple(map(fn, *args)) def mapt(fn, *args):
    return tuple(map(fn, *args)) mapt n = int(input()) int(input()) n d = mapt(int, input().split(" ")) mapt(int, input().split(" ")) d
from itertools import combinations

def mapt(fn, *args):
    return tuple(map(fn, *args))

n = int(input())
d = mapt(int, input().split(" "))

print(sum(d[a]*d[b] for a, b in combinations(range(n), 2)))