calc :: [Integer] -> Integer
calc ds = (sum $ map (\x -> (sum $ map (x *) ds) - (x * x)) ds) `div` 2

main = do
  n <- readLn :: IO Int
  ds <- map read . words <$> getLine :: IO [Integer]
  putStrLn $ show $ calc ds
