#include <bits/stdc++.h>
using namespace std;
 
const int N = 1e5 + 5;
 
int n;
vector<int> g[N];
int A, newA, lim;
 
int dfs(int u,int p) {
	multiset<int> ms;
	for (int v : g[u]) if (v != p) {
		ms.insert(dfs(v, u) + 1);
	}
	
	vector<int> rem;
	while (!ms.empty()) {
		multiset<int>::iterator it = ms.end();
		int x = *(--it);
		ms.erase(it);
		it = ms.upper_bound(lim - x);
		if (it == ms.begin()) rem.push_back(x);
		else ms.erase(--it), newA++; 
	}
	
	reverse(rem.begin(), rem.end());
	while (!rem.empty() && rem.back() == lim) newA++, rem.pop_back();
	if (rem.empty()) return 0;
	else { newA += rem.size() - 1; return rem[0]; }
}
 
bool check() {
	newA = 0;
	newA += dfs(1, 1) > 0;
	return newA == A;
}
 
int main() {
	ios_base::sync_with_stdio(false);
	cin >> n;
	for (int i = 1; i <= n - 1; ++i) {
		int u, v; cin >> u >> v;
		g[u].push_back(v), g[v].push_back(u);
	}
	for (int i = 1; i <= n; ++i) {
		A += g[i].size() & 1;
	}
	A /= 2;
	int l = 1, r = n;
	while (l < r) {
		lim = l + r >> 1;
		if (check()) r = lim;
		else l = lim + 1;
	}
	cout << A << ' ' << l << '\n';
}