#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 * 100 + 15;
int n, mark[maxn], h[maxn], d[maxn], g[2], cnt, c, w;
vector<int> ad[maxn];
void dfs(int v) {
  mark[v] = 1;
  for (auto u : ad[v]) {
    if (mark[u] == 0) {
      h[u] = h[v] + 1;
      dfs(u);
    }
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    ad[u].push_back(v);
    ad[v].push_back(u);
    d[u]++;
    d[v]++;
  }
  dfs(1);
  for (int i = 1; i <= n; i++) {
    cnt = 0;
    if (d[i] <= 1) {
      g[h[i] % 2] = 1;
    }
    for (auto u : ad[i]) {
      if (d[u] == 1) cnt++;
    }
    if (cnt > 1) {
      c++;
      w += cnt;
    }
  }
  if (g[0] && g[1])
    cout << 3;
  else
    cout << 1;
  cout << " ";
  cout << n - 1 + c - w;
}
