#include<iostream>
#include<cstring> 
#include<cstdio>
#include<set>
#define MN 100000
using namespace std;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
multiset<int>s[MN+5];
multiset<int>::iterator it;
int n,f[MN+5],head[MN+5],cnt,ans,flag,mid,rt,d[MN+5];
struct edge{int to,next;}e[MN*2+5];
inline void ins(int f,int t){
	e[++cnt]=(edge){t,head[f]};head[f]=cnt;++d[f];
	e[++cnt]=(edge){f,head[t]};head[t]=cnt;++d[t];
}
void dfs(int x,int fa){
	s[x].clear();f[x]=0;
	for(int i=head[x];i;i=e[i].next)
		if(e[i].to!=fa)dfs(e[i].to,x),s[x].insert(f[e[i].to]+1);
	int has=0,has2=0,size=s[x].size();
	if(!size)ans++;ans-=(size-1)/2;
	if(s[x].size()&&(*(--(it=s[x].end())))>mid) return(void)(flag=0);
	while(!s[x].empty()){
		it=s[x].end();--it;
		int v=*it;s[x].erase(it);
		it=s[x].upper_bound(mid-v);
		if(it==s[x].begin())
			if(!has) has=v,f[x]=has;
			else if(~size&1)
				if(!has2)has2=v,f[x]=has2;
				else return(void)(flag=0);
			else return (void)(flag=0);
		else s[x].erase(--it);
	}
}
int main(){
	n=read();
	for(int i=1;i<n;i++)ins(read(),read());
	int l=1,r=n,res,Ans;
	for(rt=1;~d[rt]&1;rt++);
	while(l<=r){
		mid=l+r>>1;ans=0;flag=1;
		dfs(rt,0);
		if(flag)res=mid,r=mid-1,Ans=ans;
		else l=mid+1;
	}
	printf("%d %d\n",Ans,res);
	return 0;
}