import Control.Monad
import Control.Applicative
import Control.Monad.State

type Count = (Int, Int)
type Nums = [Int]
type CountState = (Count, Nums)

toSpace :: String -> String
toSpace [] = []
toSpace (x:xs) = if x == ','
                      then ' ' : toSpace xs
                      else x : toSpace xs

solve :: State CountState Count
solve = do
  ((rec, loz), numList) <- get
  if numList == []
    then return (rec, loz)
    else do
      let (x:y:z:zs) = numList
      if x^2 + y^2 == z^2
        then do
          put ((rec + 1, loz), zs)
          solve
        else if x == y
          then do
            put ((rec, loz + 1), zs)
            solve
          else do
            put ((rec, loz), zs)
            solve

main = do
  contents <- join <$> map (map (read :: String -> Int) . words . toSpace) . lines <$> getContents
  let ans = evalState solve ((0, 0), contents)
  print $ fst ans
  print $ snd ans