def distance(x,y) 2.times.inject(0) {|s, a| s + (x[a] - y[a]) ** 2 } end n = gets.to_i coins = n.times.map { gets.split.map(&:to_i) } seat = coins.inject([]) {|s, i| unless s.any? {|j| distance(i,j) < 400 } s.push(i) end s } puts seat.size