#include <bits/stdc++.h>
using namespace std;
ifstream fin("AAtest.in.txt");
int n, a, b, in, mituvahem, miin = 1;
struct pu {
  int le = 1, klp = 1, klpt = 0, yl, k = 0;
  vector<int> v;
  void mine(pu p[], int &i) {
    while (k != (int)v.size()) {
      if (v[k] != yl) {
        le = 0, klp = 0;
        p[v[k]].yl = i;
        i = v[k];
        k++;
        return;
      } else
        k++;
    }
    k = 0;
    int mv = 0, ps = 0, pt = 0;
    for (int(k) = (0); ((k)) < ((v.size())); ((k))++) {
      if (v[k] == yl) continue;
      if (p[v[k]].le) mv++;
      if (p[v[k]].klp) {
        ps = 1;
        klpt = 1;
      }
      if (p[v[k]].klpt) {
        pt = 1;
        klp = 1;
      }
    }
    if (ps and pt) miin = 3;
    mituvahem += max(mv - 1, 0);
    i = yl;
    return;
  };
} p[100005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cerr.tie(0);
  cin >> n;
  for (int(i) = (0); ((i)) < ((n - 1)); ((i))++) {
    cin >> a >> b;
    p[a].v.emplace_back(b);
    p[b].v.emplace_back(a);
  }
  for (int(i) = (0); ((i)) < ((n + 1)); ((i))++)
    if (i and p[i].v.size() > 1) {
      int in = i;
      p[in].yl = -1;
      while (in != -1) p[in].mine(p, in);
      break;
    }
  cout << miin << " " << n - 1 - mituvahem;
}
