def main():
    n = int(input())
    inlis = list(map(int, input().split()))
    ans = 0
    for i in range(n):
        for j in range(n):
            if i < j:
                ans += inlis[i] * inlis[j]
    print(ans)
    
    
    
if __name__ == "__main__":
    main() def main():
    n = int(input())
    inlis = list(map(int, input().split()))
    ans = 0
    for i in range(n):
        for j in range(n):
            if i < j:
                ans += inlis[i] * inlis[j]
    print(ans)
    
    
     main n = int(input()) n int(input()) int input() input inlis = list(map(int, input().split())) inlis list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = 0 ans 0 for i in range(n):
        for j in range(n):
            if i < j:
                ans += inlis[i] * inlis[j]
     i range(n) range n for j in range(n):
            if i < j:
                ans += inlis[i] * inlis[j]
     j range(n) range n if i < j:
                ans += inlis[i] * inlis[j]
     i < j i j ans += inlis[i] * inlis[j] ans inlis[i] * inlis[j] inlis[i] inlis i inlis[j] inlis j print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    inlis = list(map(int, input().split()))
    ans = 0
    for i in range(n):
        for j in range(n):
            if i < j:
                ans += inlis[i] * inlis[j]
    print(ans)
    
    
     def main():
    n = int(input())
    inlis = list(map(int, input().split()))
    ans = 0
    for i in range(n):
        for j in range(n):
            if i < j:
                ans += inlis[i] * inlis[j]
    print(ans)
    
    
     main
def main():
    n = int(input())
    inlis = list(map(int, input().split()))
    ans = 0
    for i in range(n):
        for j in range(n):
            if i < j:
                ans += inlis[i] * inlis[j]
    print(ans)
    
    
    
if __name__ == "__main__":
    main()
