output_description: Print the sum of the health points restored from eating two takoyaki over all
  possible choices of two takoyaki from the N takoyaki served.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      d_1 d_2 ... d_N
attempt: # -*- coding: utf-8 -*-
  
  import sys
  from itertools import combinations
  
  
  def input():
      return sys.stdin.readline().strip()
  
  
  def list2d(a, b, c):
      return [[c] * b for i in range(a)]
  
  
  def list3d(a, b, c, d):
      return [[[d] * c for j in range(b)] for i in range(a)]
  
  
  def list4d(a, b, c, d, e):
      return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
  
  
  def ceil(x, y=1):
      return int(-(-x // y))
  
  
  def INT():
      return int(input())
  
  
  def MAP():
      return map(int, input().split())
  
  
  def LIST(N=None):
      return list(MAP()) if N is None else [INT() for i in range(N)]
  
  
  def Yes():
      print("Yes")
  
  
  def No():
      print("No")
  
  
  def YES():
      print("YES")
  
  
  def NO():
      print("NO")
  
  
  sys.setrecursionlimit(10**9)
  INF = float("inf")
  MOD = 10**9 + 7
  
  N = MAP()
  A = LIST()
  
  ans = 0
  for a, b in combinations(A, 2):
      ans += a * b
  print(ans)
  
problem_description: Statement
  
  It's now the season of TAKOYAKI FESTIVAL!
  
  This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will
  be served. The _deliciousness_ of the i-th takoyaki is d_i.
  
  As is commonly known, when you eat two takoyaki of deliciousness x and y
  together, you restore x \times y health points.
  
  There are \frac{N \times (N - 1)}{2} ways to choose two from the N takoyaki
  served in the festival. For each of these choices, find the health points
  restored from eating the two takoyaki, then compute the sum of these \frac{N
  \times (N - 1)}{2} values.
samples: [{"input": "3\n    3 1 2", "output": "11\n    \n\nThere are three possible choices:\n\n  * Eat the first and second takoyaki. You will restore 3 health points.\n  * Eat the second and third takoyaki. You will restore 2 health points.\n  * Eat the first and third takoyaki. You will restore 6 health points.\n\nThe sum of these values is 11.\n\n* * *"}, {"input": "7\n    5 0 7 8 3 3 2", "output": "312"}]