main :: IO ()
sti str = read str :: Int
sum2 = foldr (+) 0
double x = x * x
main = do
    n <- getLine
    line <- getLine
    let l = map sti $ words line
        double_sum = double $ sum2 l
        sum_double = sum2 $ map double l
    print $ round $ fromIntegral (double_sum - sum_double) / 2
