#include #include #include #include #include #include #include #include #include #include #include using namespace std; //#define __int64 long long #define long __int64 #define REP(i,a,b) for(int i=a;i > > > field; bool check(int testy, int testx){ int fy = min(Kazu - 1, testy / Pat); int fx = min(Kazu - 1, testx / Pat); int kyori; for(int iy=max(0,fy-1); iy<=min(Kazu-1,fy+1); iy++){ for(int ix=max(0,fx-1); ix<=min(Kazu-1, fx+1); ix++){ for(int i=0; i > > >(Kazu, vector > >(Kazu, vector >())); cin >> n; rep(i,n){ cin >> x >> y; if(check(y,x)){ ans ++; } } cout << ans << endl; return 0; }