#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; typedef double DB; typedef pair PII; typedef vector VI; #define X first #define Y second #define pb push_back template inline void chkmin(T &x, T y) { if (y < x) x = y; } template inline void chkmax(T &x, T y) { if (x < y) x = y; } #define INF 1e10 #define EPS 1e-8 #define CP const Point& struct Point { int x, y; inline void input() { scanf("%d%d", &x, &y); } bool operator<(const Point &p) const { if (y != p.y) return y < p.y; return x < p.x; } } O, T, p[25], pp[4]; double dis(CP p1, CP p2) { return hypot(p1.x - p2.x, p1.y - p2.y); } double vect(CP p, CP p1, CP p2) { return (p1.x - p.x) * (p2.y - p.y) - (p2.x - p.x) * (p1.y - p.y); } double scal(CP p, CP p1, CP p2) { return (p1.x - p.x) * (p2.x - p.x) + (p1.y - p.y) * (p2.y - p.y); } const int MN = 25; int n; int ans, cnt; int chk[MN]; int id[MN], t; bool right() { int i, j, k, t; for (i = 0; i < 4; i++) { j = (i + 1) % 4, k = (i + 2) % 4, t = (i + 3) % 4; if (fabs(dis(pp[i], pp[j]) - dis(pp[j], pp[k])) > EPS) break; if (fabs(vect(pp[i], pp[j], pp[k]) - vect(pp[j], pp[k], pp[t])) > EPS) break; if (fabs(scal(pp[i], pp[j], pp[k]) - scal(pp[j], pp[k], pp[t])) > EPS) break; } if (i == 4) return 1; return 0; } int main() { // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); int i, j, k, q, t;; while (scanf("%d", &n) == 1) { for (i = 0; i < n; i++) p[i].input(); int cnt = 0; for (i = 0; i < n; i++) { for (j = i + 1; j < n; j++) { for (k = j + 1; k < n; k++) { for (q = k + 1; q < n; q++) { pp[0] = p[i]; pp[1] = p[j]; pp[2] = p[k]; pp[3] = p[q]; sort(pp, pp + 4); swap(pp[2], pp[3]); if (right()) cnt++; } } } } printf("%d\n", cnt); } return 0; }