#include <bits/stdc++.h>
using namespace std;
vector<int> e[500005];
int n, cnt;
int bs;
void dfs(int v, int d = 0, int p = -1) {
  for (int u : e[v]) {
    if (u != p) {
      dfs(u, d + 1, v);
    }
    if (e[v].size() == 1) {
      bs |= (1 << (d % 2));
    }
  }
}
void solve() {
  cin >> n;
  for (int i = 0, u, v; i < n - 1; i++) {
    cin >> u >> v;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfs(1);
  set<int> s;
  for (int i = 1; i <= n; i++) {
    if (e[i].size() == 1) {
      cnt++;
      s.insert(e[i][0]);
    }
  }
  cout << (__builtin_popcount(bs) == 1 ? 1 : 3) << ' '
       << (n - cnt) - 1 + s.size() << '\n';
}
int main() {
  int t = 1;
  for (int no = 1; no <= t; no++) {
    solve();
  }
}
