solve :: [[Float]] -> (Int, Int)
solve = foldl f (0, 0)
  where
    f r@(r1, r2) (ai:bi:ci:_)
      | ai == bi                = (r1, r2 + 1) -- ????????¢
      | ai^2 + bi^2 == ci ^ 2   = (r1 + 1, r2) -- ????????¢
      | otherwise               = r            -- ?????????

main :: IO ()
main = getContents >>= printResult . solve . parseInput
  where
    parseInput = map (map read . words) . lines . map c2s
    c2s ',' = ' '
    c2s c   = c
    printResult (r1, r2) = print r1 >> print r2