#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
vector<int> g[N];
int d[N];
void dfs(int v, int pr) {
  d[v] = d[pr] + 1;
  for (auto i : g[v]) {
    if (i != pr) {
      dfs(i, v);
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    g[a].emplace_back(b);
    g[b].emplace_back(a);
  }
  dfs(1, 0);
  int a = 1, b = n - 1;
  for (int i = 1; i <= n; ++i) {
    if (d[i] % 2 == 0 && g[i].size() == 1) {
      for (int j = 1; j <= n; ++j) {
        if (d[j] % 2 == 1 && g[j].size() == 1) {
          a = 3;
          break;
        }
      }
      break;
    }
  }
  for (int i = 1; i <= n; ++i) {
    int x = 0;
    for (auto v : g[i]) {
      if (g[v].size() == 1) {
        ++x;
      }
    }
    b -= max(x - 1, 0);
  }
  cout << a << " " << b;
}
