#include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
using vi = vector<int>;
using vii = vector<ii>;
using vvi = vector<vi>;
using ll = long long int;
const int MOD = 1000 * 1000 * 1000 + 7;
int dfsmin(int nact, int nant, vvi const& listaAdy, bool& distImp) {
  if (nant != -1 && listaAdy[nact].size() == 1)
    return 1;
  else if (listaAdy[nact].size() > 1) {
    vi dists;
    for (int ady : listaAdy[nact]) {
      if (ady != nant) {
        dists.push_back(dfsmin(ady, nact, listaAdy, distImp));
      }
    }
    for (int i = 1; i < dists.size(); ++i) {
      if (dists[0] % 2 != dists[i] % 2) distImp = true;
    }
    return (dists[0] + 1) % 2;
  } else {
    if (dfsmin(listaAdy[nact][0], nact, listaAdy, distImp) == 1) distImp = true;
    return 0;
  }
}
int dfsmax(int nact, int nant, vvi const& listaAdy) {
  int sol = 0;
  bool leafs = false;
  for (int ady : listaAdy[nact]) {
    if (ady != nant) {
      if (listaAdy[ady].size() == 1)
        leafs = true;
      else
        sol += dfsmax(ady, nact, listaAdy) + 1;
    }
  }
  if (leafs) sol += 1;
  return sol;
}
int main() {
  int n;
  cin >> n;
  vvi listaAdy(n);
  for (int i = 0; i < n - 1; ++i) {
    int ini, fin;
    cin >> ini >> fin;
    --ini;
    --fin;
    listaAdy[ini].push_back(fin);
    listaAdy[fin].push_back(ini);
  }
  int rootleaf = -1;
  int rootnotleaf = -1;
  for (int i = 0; i < n; ++i) {
    if (listaAdy[i].size() == 1)
      rootleaf = i;
    else
      rootnotleaf = i;
    if (rootnotleaf != -1 && rootleaf != -1) break;
  }
  bool distImp = false;
  dfsmin(rootleaf, -1, listaAdy, distImp);
  if (distImp)
    cout << 3;
  else
    cout << 1;
  cout << ' ' << dfsmax(rootnotleaf, -1, listaAdy) << '\n';
  return 0;
}
