#include #include #include #include #include #define LL long long using namespace std; const int N = 100; const int H = 1007; struct Point { int x,y; }; Point p[N]; struct Node { int x,y; int next; }; Node node[N]; int cur,n; LL ans; int vis[H]; void Insert(int x,int y) { int h = (x * x + y * y) % H; node[cur].x = x; node[cur].y = y; node[cur].next = vis[h]; vis[h] = cur++; } bool ok(int x,int y) { int h = (x * x + y * y) % H; int t = vis[h]; while(t != -1) { if(x == node[t].x && y == node[t].y) return true; t = node[t].next; } return false; } void solve() { for(int i=0;i>= 2; } int main() { while(scanf("%d",&n)!=EOF) { if(n<=3) { printf("0\n"); continue; } for(int i=0;i