import Data.Int

main = getContents >>= print . solve 0 . map (read:: String->Int64) . tail . words

solve cnt (d:[]) = cnt
solve cnt (d:x:y:z)
  | x^2 + y^2 <= d^2 = solve (cnt + 1) (d:z)
  | otherwise = solve cnt (d:z)