#include<bits/stdc++.h>

using namespace std;

set<pair<int, int> > st, res;

int main(){
  int n;
  cin >> n;
  int sum = 0;
  vector<pair<int, int> > v;
  for(int i = 0; i< n;i++){
    pair<int, int> tmp;
    cin >> tmp.first >> tmp.second;
    v.push_back(tmp);
    st.insert(tmp);
  }

  for(int i = 1; i < n;i++){
    pair<int, int> vec,vec2;
    vec.first = v[i].first - v[0].first;
    vec.second = v[i].second - v[0].second;
    vec2.first = -vec.first;
    vec2.second = -vec.second;
    if(res.count(vec2)){
      continue;
    }
    res.insert(vec);
    for(int j = 0; j < n;j++){
      pair<int, int> tmp, tmp2;
      tmp.first = vec.first + v[j].first;
      tmp.second = vec.second + v[j].second;
      tmp2.first = v[j].first - vec.first;
      tmp2.second = v[j].second - vec.second;
      if(!(st.count(tmp) || st.count(tmp2))){
	break;
      }
      else if((st.count(tmp) || st.count(tmp2)) && j == n-1){
	  sum++;
      }
    }
  }
  cout << sum*2 << endl;
}
	
	
	

