import Data.Fixed (Pico)
import Data.List (delete)

judge :: [Pico] -> [Pico] -> Int
judge [x1,y1] [x2,y2]
  | (x1 - x2)^2 + (y1 - y2)^2 <= 4 = 1
  | otherwise                       = 0

alljudge :: [[Pico]] -> [[Pico]] -> Int -> Int
alljudge (x:xs) ys n
  | xs == []         = n
  | mapmax x ys > n  = alljudge xs ys (mapmax x ys)
  | otherwise        = alljudge xs ys n
    where
      mapmax :: [Pico] -> [[Pico]] -> Int
      mapmax x ys
        | mapmax' x ys == 1 = 0
        | otherwise         = mapmax' x ys
          where
            mapmax' x ys = sum (map (judge x) ys)

mybreak ns = map (delete ',')  [fst (fb ns), snd (fb ns)]
 where
   fb ns = break (== ',') ns

trns mcr = map (read :: String -> Pico) $ mybreak $ delete ' ' mcr

test xs ys n = do
  if n == 0 then test2 (ys ++  [alljudge xs xs 0])
     else do
       s <- getLine
       test (xs ++  [trns s]) ys (n - 1)

test2 ys = do
  s <- readLn
  if s == 0 then putStr $ unlines $ map show ys
  else do
    test [] ys s

main = test2 []