''' Created on 2015/06/06 @author: kiyo ''' import math def main(): def check(x, y): for dy in range(-1, 2): for dx in range(-1, 2): bx, by = x // size + dx, y // size + dy if 0 <= bx < 20000 // size + 1 and 0 <= by < 20000 //size + 1: for cx, cy in L[bx][by]: if (x-cx)**2 + (y-cy)**2 < 400: return False; return True; n = int(input()) size = 140 L = [[[] for i in range(20000 // size + 1)] for j in range(20000 // size + 1)] ans = 0 for i in range(n): x, y = map(int, input().split()) if check(x, y): ans += 1 L[x//size][y//size].append((x, y)) print(ans) if __name__ == '__main__': main()