import sys

import numpy as np



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N = ir()

D = np.array(lr())

recover = D[:, None] * D[None, :]

np.fill_diagonal(recover, 0)

answer = recover.sum() // 2

print(answer)

import sys

import numpy as np



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N = ir()

D = np.array(lr())

recover = D[:, None] * D[None, :]

answer = recover.sum() - np.diag(recover).sum()

print((answer // 2))

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
D = np.array(lr())
recover = D[:, None] * D[None, :]
np.fill_diagonal(recover, 0)
answer = recover.sum() // 2
print(answer)

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
D = np.array(lr())
recover = D[:, None] * D[None, :]
answer = recover.sum() - np.diag(recover).sum()
print((answer // 2))

-np.fill_diagonal(recover, 0) -answer = recover.sum() // 2 -print(answer) +answer = recover.sum() - np.diag(recover).sum() +print((answer // 2))