#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class t, class u>
void chmax(t& first, u second) {
  if (first < second) first = second;
}
template <class t, class u>
void chmin(t& first, u second) {
  if (second < first) first = second;
}
template <class t>
using vc = vector<t>;
template <class t>
using vvc = vc<vc<t>>;
using pi = pair<int, int>;
using vi = vc<int>;
template <class t, class u>
ostream& operator<<(ostream& os, const pair<t, u>& p) {
  return os << "{" << p.first << "," << p.second << "}";
}
template <class t>
ostream& operator<<(ostream& os, const vc<t>& v) {
  os << "{";
  for (auto e : v) os << e << ",";
  return os << "}";
}
using uint = unsigned;
using ull = unsigned long long;
template <class t, size_t n>
ostream& operator<<(ostream& os, const array<t, n>& first) {
  return os << vc<t>(first.begin(), first.end());
}
template <int i, class T>
void print_tuple(ostream&, const T&) {}
template <int i, class T, class H, class... Args>
void print_tuple(ostream& os, const T& t) {
  if (i) os << ",";
  os << get<i>(t);
  print_tuple<i + 1, T, Args...>(os, t);
}
template <class... Args>
ostream& operator<<(ostream& os, const tuple<Args...>& t) {
  os << "{";
  print_tuple<0, tuple<Args...>, Args...>(os, t);
  return os << "}";
}
template <class t>
void print(t x, int suc = 1) {
  cout << x;
  if (suc == 1) cout << "\n";
  if (suc == 2) cout << " ";
}
ll read() {
  ll i;
  cin >> i;
  return i;
}
vi readvi(int n, int off = 0) {
  vi v(n);
  for (int i = int(0); i < int(n); i++) v[i] = read() + off;
  return v;
}
template <class T>
void print(const vector<T>& v, int suc = 1) {
  for (int i = int(0); i < int(v.size()); i++)
    print(v[i], i == int(v.size()) - 1 ? suc : 2);
}
string readString() {
  string s;
  cin >> s;
  return s;
}
template <class T>
T sq(const T& t) {
  return t * t;
}
void yes(bool ex = true) {
  cout << "Yes"
       << "\n";
  if (ex) exit(0);
}
void no(bool ex = true) {
  cout << "No"
       << "\n";
  if (ex) exit(0);
}
void possible(bool ex = true) {
  cout << "Possible"
       << "\n";
  if (ex) exit(0);
}
void impossible(bool ex = true) {
  cout << "Impossible"
       << "\n";
  if (ex) exit(0);
}
constexpr ll ten(int n) { return n == 0 ? 1 : ten(n - 1) * 10; }
const ll infLL = LLONG_MAX / 3;
const int inf = INT_MAX / 2 - 100;
int topbit(signed t) { return t == 0 ? -1 : 31 - __builtin_clz(t); }
int topbit(ll t) { return t == 0 ? -1 : 63 - __builtin_clzll(t); }
int botbit(signed first) { return first == 0 ? 32 : __builtin_ctz(first); }
int botbit(ll first) { return first == 0 ? 64 : __builtin_ctzll(first); }
int popcount(signed t) { return __builtin_popcount(t); }
int popcount(ll t) { return __builtin_popcountll(t); }
bool ispow2(int i) { return i && (i & -i) == i; }
ll mask(int i) { return (ll(1) << i) - 1; }
bool inc(int first, int second, int c) {
  return first <= second && second <= c;
}
template <class t>
void mkuni(vc<t>& v) {
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
}
ll rand_int(ll l, ll r) {
  static mt19937_64 gen(chrono::steady_clock::now().time_since_epoch().count());
  return uniform_int_distribution<ll>(l, r)(gen);
}
template <class t>
void myshuffle(vc<t>& first) {
  for (int i = int(0); i < int(int(first.size())); i++)
    swap(first[i], first[rand_int(0, i)]);
}
template <class t>
int lwb(const vc<t>& v, const t& first) {
  return lower_bound(v.begin(), v.end(), first) - v.begin();
}
using ld = ll;
using cm = complex<signed>;
const ld eps = 1e-8;
int sgn(ld first) { return first < -eps ? -1 : (first > eps ? 1 : 0); }
ld rabs(cm first) { return max(abs(first.real()), abs(first.imag())); }
ld signed_rabs(cm first) {
  if (abs(first.real()) > abs(first.imag()))
    return first.real();
  else
    return first.imag();
}
ld dot(cm first, cm second) {
  return ld(first.real()) * second.real() + ld(first.imag()) * second.imag();
}
ld crs(cm first, cm second) {
  return ld(first.real()) * second.imag() - ld(first.imag()) * second.real();
}
ld crs(cm first, cm second, cm c) { return crs(second - first, c - first); }
int ccw(cm first, cm second) { return sgn(crs(first, second)); }
int ccw(cm first, cm second, cm c) { return ccw(second - first, c - first); }
auto cmless = [](const cm& first, const cm& second) {
  return first.real() != second.real() ? first.real() < second.real()
                                       : first.imag() < second.imag();
};
bool cmeq(cm first, cm second) {
  return sgn(first.real() - second.real()) == 0 &&
         sgn(first.imag() - second.imag()) == 0;
};
int argtype(cm first) {
  if (sgn(first.imag()) == 0) return first.real() < 0 ? 1 : 0;
  return first.imag() < 0 ? 0 : 1;
}
int argcmp(cm first, cm second) {
  int at = argtype(first), bt = argtype(second);
  if (at != bt) return at < bt ? -1 : 1;
  return -ccw(first, second);
};
bool argless(cm first, cm second) { return argcmp(first, second) < 0; }
int bet(cm first, cm second, cm c) {
  cm d = second - first;
  ld e = dot(d, c - first);
  if (sgn(e) <= 0) return sgn(e) - 1;
  return sgn(e - norm(d)) + 1;
}
int cont(cm first, cm second, cm c, cm d) {
  if (ccw(first, second, c) == -1) swap(second, c);
  return min({ccw(first, second, d), ccw(second, c, d), ccw(c, first, d)}) + 1;
}
cm rot90(cm first) { return cm(-first.imag(), first.real()); }
int gcd(int first, int second) {
  return second ? gcd(second, first % second) : first;
}
cm normdir(cm first) {
  if (first == cm(0, 0)) return first;
  int g = gcd(abs(first.real()), abs(first.imag()));
  return cm(first.real() / g, first.imag() / g);
}
struct ysp {
  struct compare {
    bool operator()(const cm& first, const cm& second) const {
      return cmless(first, second);
    }
  };
  multiset<cm, compare> p, q;
  void fin() {
    auto itr = q.begin();
    while (itr != q.end()) {
      bool ok = false;
      if (int(p.size()) <= 1) {
        ok = true;
      } else {
        if (ccw(*p.begin(), *p.rbegin(), *itr) == 0) ok = true;
      }
      if (!ok) break;
      p.insert(*itr);
      itr = q.erase(itr);
    }
  }
  void add(cm first) {
    q.insert(first);
    fin();
  }
  void rem(cm first) {
    auto itr = p.find(first);
    if (itr != p.end()) {
      p.erase(itr);
    } else {
      itr = q.find(first);
      assert(itr != q.end());
      q.erase(itr);
    }
    fin();
  }
  bool val(cm& dir) {
    if (int(q.size())) return false;
    assert(int(p.size()));
    dir = *p.begin() - *p.rbegin();
    if (dir == cm(0, 0)) {
      print(-1);
      exit(0);
    }
    if (cmless(dir, cm(0, 0))) dir = -dir;
    dir = normdir(dir);
    return true;
  }
};
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(20);
  int n;
  cin >> n;
  if (n <= 2) {
    print(-1);
    return 0;
  }
  vc<cm> first(n);
  for (int i = int(0); i < int(n); i++) {
    int p, q;
    cin >> p >> q;
    first[i] = cm(p, q);
  }
  vi idx(n);
  iota(idx.begin(), idx.end(), 0);
  sort(idx.begin(), idx.end(),
       [&](int i, int j) { return cmless(first[i], first[j]); });
  reverse(idx.begin(), idx.end());
  vi pos(n);
  for (int i = int(0); i < int(n); i++) pos[idx[i]] = i;
  struct T {
    cm v;
    ll first, second;
    int i, j;
    bool operator<(const T& r) const {
      int s = argcmp(v, r.v);
      if (s) return s < 0;
      if (first != r.first) return first < r.first;
      return second < r.second;
    }
  };
  vc<T> evs;
  evs.reserve(n * (n - 1));
  for (int i = int(0); i < int(n); i++)
    for (int j = int(0); j < int(n); j++)
      if (i != j) {
        cm dir = normdir(first[j] - first[i]);
        evs.push_back(
            {-rot90(dir), dot(first[i], dir), dot(first[j], dir), i, j});
      }
  sort(evs.begin(), evs.end());
  evs.resize(n * (n - 1) / 2);
  ysp mk;
  vi now(n);
  auto add = [&](int i) {
    chmin(i, n - 1 - i);
    if (now[i]) return;
    mk.add(cm(first[idx[i]] + first[idx[n - 1 - i]]));
    now[i] = 1;
  };
  auto rem = [&](int i) {
    chmin(i, n - 1 - i);
    if (!now[i]) return;
    mk.rem(cm(first[idx[i]] + first[idx[n - 1 - i]]));
    now[i] = 0;
  };
  for (int i = int(0); i < int(n); i++) add(i);
  vc<cm> ans;
  for (auto eve : evs) {
    int i = eve.i, j = eve.j;
    i = pos[i], j = pos[j];
    assert(i - 1 == j);
    rem(i);
    rem(j);
    swap(idx[i], idx[j]);
    swap(pos[idx[i]], pos[idx[j]]);
    add(i);
    add(j);
    cm tmp;
    if (mk.val(tmp)) ans.push_back(tmp);
  }
  sort(ans.begin(), ans.end(), cmless);
  ans.erase(unique(ans.begin(), ans.end(), cmeq), ans.end());
  print(int(ans.size()));
}
