placed = set() X0 = [(0,9),(1,9),(2,9),(3,9),(4,9),(4,8),(5,8),(5,7),(6,7), (7,7),(7,6),(7,5),(8,5),(8,4),(9,1),(9,2),(9,3),(9,4)] X = X0[:] for x,y in X0: X.append((-x,y)) X.append((x,-y)) X.append((-x,-y)) X = set(X) ans = 0 for _ in range(int(input())): x,y = map(int,input().split()) f = False for dx,dy in X: if (x+dx,y+dy) in placed: f = True break if f: break else: ans += 1 for dx,dy in X: placed.add((x+dx,y+dy)) print(ans)