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)] X1 = X0[:] for x, y in X0: X1.append((-x, y)) X1.append((x, -y)) X1.append((-x, -y)) W = 20050 placed = set() ans = 0 for _ in range(int(input())): x, y = map(int, input().split()) x += 10 y += 10 f = False for dx, dy in X1: if (x + dx) * W + y + dy in placed: f = True break if f: break else: ans += 1 for dx, dy in X1: placed.add((x + dx) * W + y + dy) print(ans)