#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const int INF = 1 << 30;
vector<int> G[100000];
int dp[100000];
bool check(vector<int> &vec, int m, int B) {
	vector<int> tmp;
	for (int i = 0; i < vec.size(); i++) {
		if (i != m) tmp.push_back(vec[i]);
	}
	int N = tmp.size();
	for (int i = 0; i < N / 2; i++) {
		if (tmp[i] + tmp[N - i - 1] > B) return 0;
	}
	return 1;
}
int solve(int v, int p, int B) {
	if (dp[v] != -1) return dp[v];
	vector<int> child;
	for (int u : G[v]) {
		if (u == p) continue;
		int ret = solve(u, v, B) + 1;
		if (ret > B) {
			return dp[v] = 1 << 30;
		}
		child.push_back(ret);
	}
	if (child.size() == 0) {
		return dp[v] = 0;
	}
	sort(child.begin(), child.end());
	int N = child.size();
	if (N % 2==0) {
		bool ok = 1;
		for (int i = 0; i < N / 2; i++) {
			if (child[i] + child[N - i - 1] > B) {
				ok = 0;
				break;
			}
		}
		if (ok) return dp[v] = 0;
		child.pop_back();
		N--;
	}
	int l = -1, r = N - 1;
	while (r - l > 1) {
		int m = (l + r) / 2;
		if (check(child, m, B)) r = m;
		else l = m;
	}
	if (check(child, r, B)) {
		return dp[v] = child[r];
	}
	return dp[v] = 1 << 30;
}
int main() {
	int N;
	cin >> N;
	for (int i = 0; i + 1 < N; i++) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	int root = 0;
	int odd = 0;
	for (int i = 0; i < N; i++) {
		if (G[i].size() % 2) {
			odd++;
			root = i;
		}
	}
	int l = -1, r = N;
	while (r - l > 1) {
		int m = (l + r) / 2;
		memset(dp, -1, sizeof(dp));
		solve(root, -1, m);
		if (dp[root] <= m) r = m;
		else l = m;
	}
	cout << odd / 2 << " " << r << endl;
}
