#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int N; cin >> N; vector X(N), Y(N); for(int i=0; i> X[i] >> Y[i]; constexpr int max_x = 20000; constexpr int max_y = 20000; constexpr int bucket_size = 10; using bucket_t = tuple; enum { x = 0, y = 1 }; map, bucket_t> bucket; int count = 0; for(int i=0; i bp = make_tuple(X[i]/bucket_size, Y[i]/bucket_size); if(bucket.find(bp) != bucket.end()) continue; for(int ix=-2; ix<=2; ix++) { for(int iy=-2; iy<=2; iy++) { tuple neighbor = bp; get(neighbor) = get(neighbor) + ix; get(neighbor) = get(neighbor) + iy; if(bucket.find(neighbor) != bucket.end()) { const int squared_distance = pow(get(bucket[neighbor])-get(b), 2) + pow(get(bucket[neighbor])-get(b), 2); if(squared_distance < 400) goto next; } } } bucket[bp] = make_tuple(X[i], Y[i]); count++; next:; } cout << count << endl; }