import Control.Monad
import Control.Applicative
import Data.Functor
import Data.List
import Data.List.Split
import Data.Char
import Data.Ord
import Data.Array.IO

readInt = read :: String -> Int
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
-- end of templete

f s = f' 0 0 s
  where
    f' rect rhom [] = [rect, rhom]
    f' rect rhom ([a,b,c]:ss)
      | a^2 + b^2 == c^2 = f' (rect+1) rhom ss
      | a == b = f' rect (rhom+1) ss
      | otherwise = f' rect rhom ss

main = map (map readInt . wordsBy (==',')) . lines <$> getContents >>= mapM_ print . f