require "complex"

def distance(p,q)
  Math.sqrt(p*p + q*q)
end

results = []

lines = readlines.map(&:chomp)

lines.each do |line|
  p, q = line.split(" ").map(&:to_i)
  result = distance(p, q)
  if result <= 5
    results << result
  end
end

puts results.count
