import System.IO (isEOF)

main = input >>= return . solve >>= output
    
input :: IO [(Int,Int,Int)]
input = do
    quit <- isEOF
    if quit then return [] else do
        line <- getLine
        let
            [a,b,c] = map read $ split ',' line
        fmap ((a,b,c):) input
    where
    split ch s = case break (== ch) s of
        (w,"") -> [w]
        (w,_:s') -> w : split ch s'

output :: (Int,Int) -> IO ()
output (a,b) = do
    print a
    print b

solve :: [(Int,Int,Int)] -> (Int,Int)
solve ps = (length $ filter isRectangle ps, length $ filter isLozenge ps)
    where
    isRectangle (a,b,d) = a^2 + b^2 == d^2
    isLozenge (a,b,_) = a == b