#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #define sz(x) (int((x).size())) #define bit(x) (1 << (x)) #define cnt1(x) (__builtin_popcount(x)) template inline void chkmax(T& x, T y) { if (x < y) x = y; } template inline void chkmin(T& x, T y) { if (y < x) x = y; } typedef long long LL; typedef double DB; typedef pair PII; typedef vector VI; struct PT { int x, y; }; inline int sqr(int x) { return x * x; } int dis2(PT& p1, PT& p2) { return sqr(p1.x - p2.x) + sqr(p1.y - p2.y); } const int MX = 25; int n; PT p[MX], q[5]; int chk[MX]; int rlt; void calc(int k) { int i, dd; if (k == 4) { dd = dis2(q[3], q[0]); if (!dd) return; for (i = 0; i < 3; i++) { if (dis2(q[i], q[i + 1]) != dd) return; } if (dis2(q[0], q[2]) != dis2(q[1], q[3])) return; rlt++; return; } for (i = 0; i < n; i++) { if (chk[i]) continue; chk[i]++; q[k] = p[i]; calc(k + 1); chk[i]--; } } int main() { int i; while (scanf("%d", &n) == 1) { for (i = 0; i < n; i++) scanf("%d%d", &p[i].x, &p[i].y); rlt = 0; calc(0); rlt /= 8; printf("%d\n", rlt); } return 0; }