#include using namespace std; using ll=long long; using ld=double; using vll=vector; #define FOR(i,a,b) for(ll i=a;i<(ll)b;++i) #define ROF(i,a,b) for(ll i=a;i>=(ll)b;--i) #define PB push_back int main(){ ios::sync_with_stdio(0);cin.tie(0); int N; scanf("%d", &N); std::vector a1(N); std::vector a2(N); std::set> s; for (int i = 0; i < N; ++i) { int x, y; scanf("%d %d", &x, &y); a1[i] = x; a2[i] = y; s.insert({x, y}); } long long c = 0; for (int i = 1; i < N; ++i) { int u1 = a1[i] - a1[0]; int u2 = a2[i] - a2[0]; bool possible = true; //printf("%d %d\n", a1[i], a2[i]); for (int j = 1; j < N; ++j) { if (j == i) continue; int p1 = a1[j] - u1; int p2 = a2[j] - u2; int q1 = a1[j] + u1; int q2 = a2[j] + u2; if (s.count({p1, p2}) == 0 && s.count({q1, q2}) == 0) { possible = false; break; } } if (possible) ++c; //printf("\n"); } printf("%lld\n", c * 2); return 0; }