#include "bits/stdc++.h" using namespace std; using ll=long long; using vll=vector< ll>; using vvll=vector< vll>; using vvvll=vector< vvll>; using vvvvll=vector; using dd=double; using vdd=vector< dd>; using vvdd=vector< vdd>; using pll=pair; using tll=tuple; using qll=tuple; using vpll=vector< pll>; constexpr ll INF = 1LL << 60; struct Fast{ Fast(){ cin.tie(0); ios::sync_with_stdio(false); cout<::max_digits10); } } fast; #define REPS(i, S, E) for (ll i = (S); i <= (E); i++) #define REP(i, N) REPS(i, 0, (N)-1) #define DEPS(i, S, E) for (ll i = (E); i >= (S); i--) #define DEP(i, N) DEPS(i, 0, (N)-1) #define rep(i, S, E) for (ll i = (S); i <= (E); i++) #define dep(i, E, S) for (ll i = (E); i >= (S); i--) #define each(e, v) for (auto&& e : v) #define ALL(v) (v).begin(), (v).end() #define RALL(v) (v).rbegin(), (v).rend() template inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; }return false; } template inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; }return false; } template inline T MaxE(vector&v,ll S,ll E){ T m=v[S]; rep(i,S,E)chmax(m,v[i]); return m; } template inline T MinE(vector&v,ll S,ll E){ T m=v[S]; rep(i,S,E)chmin(m,v[i]); return m; } template inline T MaxE(vector &v) { return MaxE(v,0,(ll)v.size()-1); } template inline T MinE(vector &v) { return MinE(v,0,(ll)v.size()-1); } template inline T Sum(vector &v,ll S,ll E){ T s=T(); rep(i,S,E)s+=v[i]; return s; } template inline T Sum(vector &v) { return Sum(v,0,v.size()-1); } template inline ll sz(T &v){ return (ll)v.size(); } inline ll CEIL(ll a,ll b){ return (a<0) ? -(-a/b) : (a+b-1)/b; } inline ll FLOOR(ll a,ll b){ return -CEIL(-a,b); } #if 0 #include using namespace atcoder; #endif //tuple3用テンプレート using vtll=vector< tll>; using vvtll=vector; template inline tuple& operator+=(tuple &a,const tuple &b){ get<0>(a)+=get<0>(b); get<1>(a)+=get<1>(b); get<2>(a)+=get<2>(b); return a; } template inline tuple& operator-=(tuple &a,const tuple &b){ get<0>(a)-=get<0>(b); get<1>(a)-=get<1>(b); get<2>(a)-=get<2>(b); return a; } template inline tuple& operator*=(tuple &a,const tuple &b){ get<0>(a)*=get<0>(b); get<1>(a)*=get<1>(b); get<2>(a)*=get<2>(b); return a; } template inline tuple& operator/=(tuple &a,const tuple &b){ get<0>(a)/=get<0>(b); get<1>(a)/=get<1>(b); get<2>(a)/=get<2>(b); return a; } template inline tuple& operator%=(tuple &a,const tuple &b){ get<0>(a)%=get<0>(b); get<1>(a)%=get<1>(b); get<2>(a)%=get<2>(b); return a; } template inline tuple& operator+=(tuple &a,Q b){ get<0>(a)+=b; get<1>(a)+=b; get<2>(a)+=b; return a; } template inline tuple& operator-=(tuple &a,Q b){ get<0>(a)-=b; get<1>(a)-=b; get<2>(a)-=b; return a; } template inline tuple& operator*=(tuple &a,Q b){ get<0>(a)*=b; get<1>(a)*=b; get<2>(a)*=b; return a; } template inline tuple& operator/=(tuple &a,Q b){ get<0>(a)/=b; get<1>(a)/=b; get<2>(a)/=b; return a; } template inline tuple& operator%=(tuple &a,Q b){ get<0>(a)%=b; get<1>(a)%=b; get<2>(a)%=b; return a; } template inline tuple operator+(const tuple &a,Q b){ tuple c=a; return c+=b; } template inline tuple operator-(const tuple &a,Q b){ tuple c=a; return c-=b; } template inline tuple operator*(const tuple &a,Q b){ tuple c=a; return c*=b; } template inline tuple operator/(const tuple &a,Q b){ tuple c=a; return c/=b; } template inline tuple operator%(const tuple &a,Q b){ tuple c=a; return c%=b; } template inline tuple operator-(Q b,const tuple &a){ tuple c=-a; return c+=b; } template inline tuple operator-(const tuple &a){ tuple c=a; return c*=(-1); } template inline ostream &operator<<(ostream &os,const tuple &a){ return os << get<0>(a) << ' ' << get<1>(a) << ' ' << get<2>(a); } template inline T POW(T a,ll n){ T r=1; for (; n>0; n>>=1,a*=a){ if (n&1)r*=a; } return r; } inline ll POW(int a,ll n){ return POW((ll)a,n); } void solve() { ll n; cin >> n; vector> xy(n); rep(i,0,n-1){ ll x; ll y; cin>>x>>y; xy[i]={x,y}; } vtll ds; rep(i,0,n-1){ rep(j,i+1,n-1){ ll x,y; tie(x,y) = xy[i]; ll xx,yy; tie(xx,yy) = xy[j]; ds.emplace_back(POW(x-xx,2)+POW(y-yy,2),i,j); } } sort(ALL(ds)); vll ans; unordered_set removed; each(e,ds){ ll d,i,j; tie(d,i,j) = e; /* どちらかが既にない→skip 0とペア→ansとremovedにいれる それ以外→removedにいれる */ if (removed.count(i)==1 or removed.count(j)==1){ continue; } if (i==0){ ans.push_back(j); removed.insert(j); } else{ removed.insert(i); removed.insert(j); } } cout << sz(ans) << '\n'; } int main(){ #if 1 solve(); #else ll t; cin >> t; rep(i, 0, t-1){ solve(); } #endif return 0; }