#include<bits/stdc++.h>
using namespace std;

#define rep(i,l,r) for(register int i = l ; i <= r ; i++)
#define repd(i,r,l) for(register int i = r ; i >= l ; i--)
#define rvc(i,S) for(register int i = 0 ; i < (int)S.size() ; i++)
#define rvcd(i,S) for(register int i = ((int)S.size()) - 1 ; i >= 0 ; i--)
#define fore(i,x)for (register int i = head[x] ; i ; i = e[i].next)
#define forup(i,l,r) for (register int i = l ; i <= r ; i += lowbit(i))
#define fordown(i,id) for (register int i = id ; i ; i -= lowbit(i))
#define pb push_back
#define prev prev_
#define stack stack_
#define mp make_pair
#define fi first
#define se second
#define lowbit(x) (x&(-x))

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<ll,int> pr;

const int inf = 2e8;
const int maxn = 100020;
const ll mod = 1e9 + 7;
struct node{
	int next,to,w;
}e[maxn * 2];

int head[maxn],cnt,rt,sz[maxn],n,deg[maxn];
int len,flag;

inline void adde(int x,int y){
	e[++cnt].to = y;
	e[cnt].next = head[x];
	head[x] = cnt;
}

void dfs(int x,int fa){
	fore(i,x){
		if ( e[i].to == fa ) continue;
		dfs(e[i].to,x);
		deg[x]++;	
	}
}
struct cmp{
	bool operator () (int x,int y){ return x > y; }
};
multiset <int,cmp> vec[maxn];
int dfs2(int x,int fa){
	fore(i,x){
		if ( e[i].to == fa ) continue;
		vec[x].insert(dfs2(e[i].to,x));
		if ( !flag ) return 0;
	}
//	sort(vec[x].begin(),vec[x].end());
	if ( !vec[x].size() ) return 1;
	if ( x == 1 ){
		if ( vec[x].size() & 1 ){
		   	flag &= *vec[x].begin() <= len;
			vec[x].erase(vec[x].begin());
		}
		if ( vec[x].size() ){
			auto it = vec[x].end();
			for (auto it2 = vec[x].begin() ; it2 != vec[x].end() ; ++it2){
				--it;
				flag &= ((*it) + (*it2)) <= len;
			}
		}
		return 0;
	}
	int l = 0;
	if ( !(vec[x].size() & 1) ){
		int cnt = 0,tag = 0;
		for (auto it = vec[x].begin() ; it != vec[x].end() ; ++it){
			if ( *it > len ){ flag =0 ; return 0; }
			if ( (*it) * 2 <= len ) break;
			auto it2 = vec[x].lower_bound(len - *it);
			if ( it2 == vec[x].end() ){
				if ( !tag ) tag = 1;
				else if ( !l ) l = (*it) + 1;
				else{ flag = 0; return 0; }
			}
			else vec[x].erase(it2);
	//		vec[x].erase(it);
			++cnt;
			if ( cnt >= vec[x].size() ) break;
		}
		auto it = vec[x].end();
		if ( !l ){
		   	if ( tag ) l = (*(--it)) + 1;
			else l = 1;
		}
	}
	else{
		int cnt = 0;
		for (auto it = vec[x].begin() ; it != vec[x].end() ; ++it){
			if ( *it > len ){ flag =0 ; return 0; }
			if ( (*it) * 2 <= len ) break;
			auto it2 = vec[x].lower_bound(len - *it);
			if ( it2 == vec[x].end() ){
				if ( !l ) l = (*it) + 1;
				else{ flag = 0; return 0; }
			}
			else vec[x].erase(it2);
	//		vec[x].erase(it);
			++cnt;
			if ( cnt >= vec[x].size() ) break;
		}
		auto it = vec[x].end();
		if ( !l ) l = (*(--it)) + 1;
	}
	return l;
}
int check(int mid){
	rep(i,1,n) vec[i].clear();
	flag = 1;
	len = mid;
	dfs2(1,0);
	return flag;
}
int main(){
	scanf("%d",&n);
	rep(i,1,n - 1){
		int x,y;
		scanf("%d %d",&x,&y);
		adde(x,y) , adde(y,x);
	}
	dfs(1,0);
	int A = 0,B = 0;
	rep(i,1,n){
		if ( i == 1 ) A += (deg[i] + 1) / 2;
		else A += deg[i] / 2;
	}
	int l = 1 , r = n;
	while ( l <= r ){
		int mid = (l + r) >> 1;
		if ( check(mid) ) B = mid , r = mid - 1;
		else l = mid + 1;
	}
	cout<<A<<" "<<B<<endl;
}




Measured memory_bytes: 21120