main :: IO ()
main = do
  n <- readLn
  ds <- map read . words <$> getLine
  print $ solve n ds

solve :: Int -> [Int] -> Int
solve n ds = sum [ ds !! i * ds !! j | i <- [0 .. n-1], j <- [i+1 .. n-1] ]