#include using namespace std; #define int long long const int maxn=2e5+5; vector a[maxn]; pair dp[maxn]; bool used[maxn]; void dfs(int x) { used[x]=true; vector ch; for(int v:a[x]) { if(!used[v]) { ch.push_back(v); dfs(v); } } if(ch.empty()) { dp[x]={0,0};return; } dp[x].second=1e18; for(int v:ch) { dp[x].first=max(dp[x].first,dp[v].second+1); dp[x].second=min(dp[x].second,dp[v].first+1); } } int32_t main() { ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); int n;cin>>n; for(int i=0;i>x>>y;--x;--y;a[x].push_back(y);a[y].push_back(x); } dfs(0); cout<