#include<bits/stdc++.h>
using namespace std;
#define REP(i,st,ed) for(int i=(int)(st),i##end=(int)(ed);i<=i##end;++i)
#define DREP(i,st,ed) for(int i=(int)(st),i##end=(int)(ed);i>=i##end;--i)
template<typename T>bool chkmin(T &x,const T &y){return x>y?x=y,1:0;}
template<typename T>bool chkmax(T &x,const T &y){return x<y?x=y,1:0;}
#ifdef __linux__
#define getchar getchar_unlocked
#define putchar putchar_unlocked
#endif
template<typename T>T read(){
	T x=0,f=1;
	char c=getchar();
	while((c<'0')||(c>'9')){if(c=='-')f=-1;c=getchar();}
	while((c>='0')&&(c<='9'))x=(x<<1)+(x<<3)+(c^48),c=getchar();
	return x*f;
}
#define read() read<int>()
template<typename T>void write(T x,char c){
	static char t[25];
	static int tlen;
	t[tlen=1]=c;
	if(x<0)putchar('-'),x=-x;
	do t[++tlen]=(x%10)^48;
	while(x/=10);
	while(tlen)putchar(t[tlen--]);
}
#define pb push_back
typedef long long ll;
typedef double lf;
const int maxn=100005;
vector<int>E[maxn];
int n,deg[maxn],dp[maxn],lim,rt;
bool dfs(int u,int fa){
	bool res=1;
	REP(i,0,E[u].size()-1){
		int v=E[u][i];
		if(v!=fa)res&=dfs(v,u);
	}
	static int c[maxn],tot;
	tot=0;
	REP(i,0,E[u].size()-1){
		int v=E[u][i];
		if(v!=fa)c[++tot]=dp[v];
	}
	if(deg[u]&1)c[++tot]=0;
	sort(c+1,c+1+tot);
	int l=1,h=tot;
	while(l<=h){
		int mid=(l+h)>>1,curl=1,curr=tot,Max=0;
		REP(i,1,tot>>1){
			if(curl==mid)curl++;
			if(curr==mid)curr--;
			chkmax(Max,c[curl]+c[curr]);
			curl++,curr--;
		}
		if(Max<=lim)h=mid-1;
		else l=mid+1;
	}
	res&=(l<=tot);
	dp[u]=c[l]+1;
	return res;
}
bool check(int x){
	lim=x;
	return dfs(rt,0)&(dp[rt]-1<=lim);
}
int main(){
	int u,v;
	n=read();
	REP(i,1,n-1){
		u=read(),v=read();
		E[u].pb(v),deg[u]++;
		E[v].pb(u),deg[v]++;
	}
	int ans=0;
	REP(i,1,n)
		if(deg[i]&1)rt=i,ans++;
	write(ans>>1,' ');
	int l=1,h=n-1;
	while(l<=h){
		int mid=(l+h)>>1;
		if(check(mid))h=mid-1;
		else l=mid+1;
	}write(l,'\n');
	return 0;
}