#include using namespace std; typedef long long LL; typedef long double LD; typedef pair < int, int > PII; typedef pair < LL, LL > PLL; #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() struct point { int x, y; }; point operator+(point a, point b) { return point{a.x + b.x, a.y + b.y}; } point operator-(point a, point b) { return point{a.x + b.x, a.y + b.y}; } const int N = 1005; int n; vector < point > vec; vector < point > tmp; bool operator <(const point &p1, const point &p2) { if(p1.x == p2.x) return p1.y < p2.y; return p1.x < p2.x; } bool operator ==(const point &p1, const point &p2) { return p1.x == p2.x && p1.y == p2.y; } bool check(point v) { tmp.clear(); for(int i = 0; i < n; i++) { point t = vec[i] + v; auto it = lower_bound(all(vec), t); if(it != vec.end() && *it == t) { tmp.push_back(t); tmp.push_back(vec[i]); } } sort(all(tmp)); tmp.erase(unique(all(tmp)), tmp.end()); return sz(tmp) == n; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; vec.resize(n); for(int i = 0; i < n; i++) { cin >> vec[i].x >> vec[i].y; } sort(all(vec)); int ans = 0; for(int i = 0; i < n; i++) { if(check(vec[i] - vec[0])) ans++; } cout << (ans - 1) * 2 << "\n"; return 0; }