#include #include using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000003 int main(){ int N; cin>>N; vector x(N),y(N); rep(i,N){ cin>>x[i]>>y[i]; } vector>> V; rep(i,N){ for(int j=i+1;j>> nV; int a = V[0].second.first,b = V[0].second.second; if(a==0){ ans ++; rep(j,V.size()){ if(V[j].second.first==b||V[j].second.second==b)continue; nV.push_back(V[j]); } } else{ rep(j,V.size()){ if(V[j].second.first==a||V[j].second.first==b||V[j].second.second==a||V[j].second.second==b)continue; nV.push_back(V[j]); } } swap(V,nV); } cout<