module Main where

import Control.Monad
import qualified Data.Vector.Unboxed as VU

import Data.Maybe (fromJust)
import Data.List
import qualified Data.ByteString.Char8 as BS


bytestr2Int = fst . fromJust . BS.readInt
getInt = bytestr2Int <$> BS.getLine
getIntL_H = map bytestr2Int. BS.words <$> BS.getLine
getIntL_V n = replicate n $ getInt
getInt2D n = replicate n $ getIntL_H


main :: IO ()
main = do
    n <- getInt
    ns <- getIntL_H
    let vecN = VU.fromList $ ns
    r <- sum <$> ( forM [0..(n-2)] $ \i -> sum <$> do
        forM [(i+1)..(n-1)] $ \j -> do
            pure $ ((vecN VU.! i)*(vecN VU.! j)::Int)
                 )
    print r

