import Control.Monad
import Data.List

comb :: Int -> [a] -> [[a]]
comb 0 xs = [[]]
comb _ [] = []
comb n (x:xs) = [x:y | y <- comb (n-1) xs] ++ comb n xs

main = do
    n <- readLn :: IO Int
    ds <- map read . words <$> getLine :: IO [Int]
    print $ sum [product xy | xy <- (comb 2 ds)]