import Data.List.Split
data BoxKind = Box | Diamond | Rect deriving (Eq,Show)
check [a,b,c] = if a^2 + b^2 == c^2 then Rect
                                    else if a == b then Diamond
                                                   else Box

main = interact $ unlines.map show.countRectAndDiamond.map (check.map read.splitOn ",").lines

countRectAndDiamond list = cra [0,0] list

cra rd [] = rd
cra [r,d] (x:xs)
    | x == Rect = cra [r+1,d] xs
    | x == Diamond = cra [r,d+1] xs
    | x == Box  = cra [r,d] xs