def main():
    N = int(input())
    d = list(map(int, input().split()))
    total = 0
    while len(d) > 1:
        c = d[0]
        for i in range(len(d) - 1):
            total = total + (c * d[1 + i])
        d.pop(0)
    print(total)
main() def main():
    N = int(input())
    d = list(map(int, input().split()))
    total = 0
    while len(d) > 1:
        c = d[0]
        for i in range(len(d) - 1):
            total = total + (c * d[1 + i])
        d.pop(0)
    print(total) main 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 total = 0 total 0 while len(d) > 1:
        c = d[0]
        for i in range(len(d) - 1):
            total = total + (c * d[1 + i])
        d.pop(0)
     len(d) > 1 len(d) len d 1 c = d[0] c d[0] d 0 for i in range(len(d) - 1):
            total = total + (c * d[1 + i])
         i range(len(d) - 1) range len(d) - 1 len(d) len d 1 total = total + (c * d[1 + i]) total total + (c * d[1 + i]) total c * d[1 + i] c d[1 + i] d 1 + i 1 i d.pop(0) d.pop d pop 0 print(total) print total main() main def main():
    N = int(input())
    d = list(map(int, input().split()))
    total = 0
    while len(d) > 1:
        c = d[0]
        for i in range(len(d) - 1):
            total = total + (c * d[1 + i])
        d.pop(0)
    print(total) def main():
    N = int(input())
    d = list(map(int, input().split()))
    total = 0
    while len(d) > 1:
        c = d[0]
        for i in range(len(d) - 1):
            total = total + (c * d[1 + i])
        d.pop(0)
    print(total) main
def main():
    N = int(input())
    d = list(map(int, input().split()))
    total = 0
    while len(d) > 1:
        c = d[0]
        for i in range(len(d) - 1):
            total = total + (c * d[1 + i])
        d.pop(0)
    print(total)
main()