import qualified Data.ByteString.Char8 as BC
import Data.Maybe
import Data.List
import qualified Data.IntMap as IM

readIntsLine :: IO [Int]
readIntsLine = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

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

solve :: [[Int]] -> Int
solve [] = 0
solve (l:ls) = result + solve ls
  where sd = sort l
        result = if last sd < sum (init sd) then 1 else 0

main :: IO ()
main = do
  getLine
  ls <- sort <$> readIntsLine
  print . solve $ comb 3 ls