size=50 def distance(ax,ay,bx,by): return (ax-bx)**2+(ay-by)**2 def check(x,y): for dx in xrange(-1,2): for dy in xrange(-1,2): bx,by=x/size+dx,y/size+dy if 0<=bx<=20000/size and 0<=by<=20000/size: for cx,cy in block[by][bx]: if 0<=distance(x,y,cx,cy)<400: return False return True N=int(raw_input()) block=[[[] for i in xrange(20000/size+1)] for j in xrange(20000/size+1)] ans=0 for _ in xrange(N): x,y=map(int,raw_input().split()) if check(x,y): ans+=1 block[y/size][x/size].append((x,y)) print ans