#include using namespace std; vector > xy; int n; double x,y; int visited[2001]; vector > > graph; int a[2005][2]; vector> g; vector > Van; double length(double x1, double y1, double x2, double y2) { return sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) ); } int f(int idx, int from, bool put){ if(a[idx][put]==-1){ int sum_ = 0; if(put){ for(auto i_:g[idx]){ if(i_ != from) sum_ += f(i_,idx,0); } } else { for(auto i_:g[idx]){ if(i_!=from){ sum_ += max(f(i_,idx, 0), f(i_,idx,1)); } } } a[idx][put] = sum_ + put; } return a[idx][put]; } int main() { ios::sync_with_stdio(0); while(cin>>n) { memset(visited,0,sizeof(visited)); for(int i=0;i>x>>y; xy.push_back(make_pair(x,y)); vector > vector1; graph.push_back(vector1); } for(int i=0;i > ,vector > >, greater > > > q; q.push(make_pair(0.0, make_pair(0,0))); while(!q.empty()) { pair > top = q.top(); q.pop(); if(!visited[top.second.first]) { if(top.second.second != 0 || top.second.first != 0) { Van.push_back(make_pair(top.second.second,top.second.first)); } for(int i=0;i< graph[top.second.first].size() ; i++) { if(!visited[graph[top.second.first][i].first]) { q.push(make_pair(graph[top.second.first][i].second, make_pair(graph[top.second.first][i].first, top.second.first))); } } visited[top.second.first] = 1; } } xy.clear(); graph.clear(); // sem pis kod g.clear(); g.resize(n+1); for(auto& i_:Van){ g[i_.first].push_back(i_.second); g[i_.second].push_back(i_.first); } memset(a,-1,sizeof(a)); cout << max(f(0,-1,0),f(0,-1,1)) << endl; Van.clear(); } return 0; }