import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    getLine
    ds <- getIntList
    print $ solve ds

solve ds = (sum [x * y| x <- ds, y <- ds] - sum [x * x| x <- ds]) `div` 2