#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int N; vector<int> G[100009];
int solve(int pos, int pre, int lim) {
	vector<int> v;
	for (int i : G[pos]) {
		if (i == pre) continue;
		int res = solve(i, pos, lim);
		if (res == -1) return -1;
		v.push_back(res);
	}
	if (G[pos].size() % 2 == 1) v.push_back(0);
	sort(v.begin(), v.end());
	if (pre == -1) {
		for (int i = 0; 2 * i < v.size(); i++) {
			if (v[i] + v[v.size() - i - 1] > lim) return -1;
		}
		return 0;
	}
	for (int i = 0; 2 * i < v.size() - 1; i++) {
		if (v[i] + v[v.size() - i - 2] > lim) return -1;
	}
	for (int i = v.size() - 1; i >= 1; i--) {
		int lp = v.size() - i - 1;
		if (lp >= i) lp++;
		if (v[i] + v[lp] > lim) return v[i] + 1;
	}
	return v[0] + 1;
}
int main() {
	cin >> N;
	for (int i = 1; i < N; i++) {
		int a, b;
		cin >> a >> b; a--, b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	int c = 0;
	for (int i = 0; i < N; i++) c += G[i].size() % 2;
	int l = 0, r = N;
	while (r - l > 1) {
		int m = (l + r) >> 1;
		int res = solve(0, -1, m);
		if (res == -1) l = m;
		else r = m;
	}
	cout << c / 2 << ' ' << r << endl;
	return 0;
}