main :: IO ()
main = do
  n <- (read :: String -> Int) <$> getLine
  dn <- map (read :: String -> Int) . words <$> getLine
  print $ ans dn

ans :: [Int] -> Int
ans dn = (`div` 2) $ (sum dn)^2 - (sum $ map (^2) dn)