# B - TAKOYAKI FESTIVAL 2019
def main():
    import itertools

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

    for v in itertools.combinations(ｄ, 2):
        sum += v[0] * v[1]
    print(sum)

if __name__ == "__main__":
    main() def main():
    import itertools

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

    for v in itertools.combinations(ｄ, 2):
        sum += v[0] * v[1]
    print(sum) main import itertools itertools 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 sum = 0 sum 0 for v in itertools.combinations(ｄ, 2):
        sum += v[0] * v[1]
     v itertools.combinations(ｄ, 2) itertools.combinations itertools combinations ｄ 2 sum += v[0] * v[1] sum v[0] * v[1] v[0] v 0 v[1] v 1 print(sum) print sum if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    import itertools

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

    for v in itertools.combinations(ｄ, 2):
        sum += v[0] * v[1]
    print(sum) def main():
    import itertools

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

    for v in itertools.combinations(ｄ, 2):
        sum += v[0] * v[1]
    print(sum) main
# B - TAKOYAKI FESTIVAL 2019
def main():
    import itertools

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

    for v in itertools.combinations(ｄ, 2):
        sum += v[0] * v[1]
    print(sum)

if __name__ == "__main__":
    main()