let rec read rect loz =
  try let l =read_line ()
                |> Str.split (Str.regexp_string ",")
             |> List.map int_of_string |> List.nth in
      let (x,y,z) = (l 0,l 1,l 2) in
      if x = y then read rect (loz+1)
      else if x*x + y*y = z*z then read (rect+1) loz
      else read rect loz
  with End_of_file -> (rect, loz);;

let () =
  let (rect, loz) = read 0 0 in
  print_endline (string_of_int rect);
  print_endline (string_of_int loz);;