import sys
from itertools import combinations


def main():
    input = sys.stdin.buffer.readline
    _n = int(input())
    d = list(map(int, input().split()))
    ans = 0
    for i, j in combinations(d, 2):
        ans += i * j
    print(ans)


if __name__ == "__main__":
    main()
 import sys sys from itertools import combinations def main():
    input = sys.stdin.buffer.readline
    _n = int(input())
    d = list(map(int, input().split()))
    ans = 0
    for i, j in combinations(d, 2):
        ans += i * j
    print(ans) main input = sys.stdin.buffer.readline input sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline _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 = 0 ans 0 for i, j in combinations(d, 2):
        ans += i * j
     i j combinations(d, 2) combinations d 2 ans += i * j ans i * j i j print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    input = sys.stdin.buffer.readline
    _n = int(input())
    d = list(map(int, input().split()))
    ans = 0
    for i, j in combinations(d, 2):
        ans += i * j
    print(ans) def main():
    input = sys.stdin.buffer.readline
    _n = int(input())
    d = list(map(int, input().split()))
    ans = 0
    for i, j in combinations(d, 2):
        ans += i * j
    print(ans) main
import sys
from itertools import combinations


def main():
    input = sys.stdin.buffer.readline
    _n = int(input())
    d = list(map(int, input().split()))
    ans = 0
    for i, j in combinations(d, 2):
        ans += i * j
    print(ans)


if __name__ == "__main__":
    main()

