#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using ll = long long; using vll = std::vector; using namespace std; #define REP(i, x, n) for(int i = x; i < (n); i++) #define rep(i, n) REP(i, 0, n) const ll MOD = 1000000007; template void gi(T &x){ int minus=0; x=0; char c=getchar(); for(;c<'0'||c>'9'; c=getchar()) minus|=(c=='-'); for(;c>='0'&&c<='9'; c=getchar()) x=(x<<1)+(x<<3)+(c^48); if(minus) x=-x; } int main() { int n; gi(n); vector> xy; rep(i,n){ int x,y; gi(x);gi(y); xy.push_back({x,y}); } vector chk(n); auto getD = [&](vector>& vec, int id1, int id2){ return sqrt((vec[id1].first-vec[id2].first)*(vec[id1].first-vec[id2].first) +(vec[id1].second-vec[id2].second)*(vec[id1].second-vec[id2].second)); }; vector> v(n); struct D{ double d; int x; int y; }; auto cmpD = [](D& l, D& r){ return l.d > r.d; }; priority_queue,decltype(cmpD)> q{cmpD}; REP(i,0,n)REP(j,i+1,n){ q.push({getD(xy,i,j),i,j}); } int ans = 0; while(!q.empty()){ D target = q.top(); q.pop(); if(target.x == 0){ if(chk[target.y] == false){ ans++; chk[target.y] = true; } } else if(chk[target.x] || chk[target.y]){ }else{ chk[target.x] = true; chk[target.y] = true; } } printf( "%d\n", ans ); return 0; }