import itertools

def takoyaki_festival2019(n, dli):

    ans = 0
    itelist = list(itertools.combinations(range(n), 2))

    for i, k in itelist:
        ans += dli[i]*dli[k]

    return ans

def main():
    n = int(input())
    dli = list(map(int, input().split()))
    print(takoyaki_festival2019(n, dli))

if __name__ == '__main__':
    main() import itertools itertools def takoyaki_festival2019(n, dli):

    ans = 0
    itelist = list(itertools.combinations(range(n), 2))

    for i, k in itelist:
        ans += dli[i]*dli[k]

    return ans takoyaki_festival2019 ans = 0 ans 0 itelist = list(itertools.combinations(range(n), 2)) itelist list(itertools.combinations(range(n), 2)) list itertools.combinations(range(n), 2) itertools.combinations itertools combinations range(n) range n 2 for i, k in itelist:
        ans += dli[i]*dli[k]

     i k itelist ans += dli[i]*dli[k] ans dli[i]*dli[k] dli[i] dli i dli[k] dli k return ans ans n n dli dli def main():
    n = int(input())
    dli = list(map(int, input().split()))
    print(takoyaki_festival2019(n, dli)) main n = int(input()) n int(input()) int input() input dli = list(map(int, input().split())) dli list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split print(takoyaki_festival2019(n, dli)) print takoyaki_festival2019(n, dli) takoyaki_festival2019 n dli if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n = int(input())
    dli = list(map(int, input().split()))
    print(takoyaki_festival2019(n, dli)) def main():
    n = int(input())
    dli = list(map(int, input().split()))
    print(takoyaki_festival2019(n, dli)) main def takoyaki_festival2019(n, dli):

    ans = 0
    itelist = list(itertools.combinations(range(n), 2))

    for i, k in itelist:
        ans += dli[i]*dli[k]

    return ans def takoyaki_festival2019(n, dli):

    ans = 0
    itelist = list(itertools.combinations(range(n), 2))

    for i, k in itelist:
        ans += dli[i]*dli[k]

    return ans takoyaki_festival2019
import itertools

def takoyaki_festival2019(n, dli):

    ans = 0
    itelist = list(itertools.combinations(range(n), 2))

    for i, k in itelist:
        ans += dli[i]*dli[k]

    return ans

def main():
    n = int(input())
    dli = list(map(int, input().split()))
    print(takoyaki_festival2019(n, dli))

if __name__ == '__main__':
    main()