main :: IO ()
main = do
    _ <- getLine
    l <- map read . words <$> getLine :: IO [Int]
    let ans = length $ [[a, b, c] | a <- l, b <- l, c <- l
                       , a + b > c
                       , a < b && b < c]
    print ans
    return()
