#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
using namespace std;
const int N = 100100;
vector<int> g[N];
int deg[N];
bool good;
int dfs(int v, int p) {
  int rem = -1;
  for (int x : g[v]) {
    if (x == p) continue;
    int tmp = dfs(x, v);
    tmp = (tmp + 1) % 2;
    if (rem == -1) {
      rem = tmp;
      continue;
    }
    if (rem != tmp) {
      good = false;
    }
  }
  if (rem == -1) {
    rem = 0;
  }
  return rem;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  for (int(i) = 0; (i) < (n - 1); (i)++) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    g[a].push_back(b);
    g[b].push_back(a);
    deg[a]++;
    deg[b]++;
  }
  int root = -1;
  for (int(i) = 0; (i) < (n); (i)++) {
    if (deg[i] >= 2) {
      root = i;
      break;
    }
  }
  good = true;
  dfs(root, -1);
  if (good)
    cout << "1 ";
  else
    cout << "3 ";
  int res = n - 1;
  for (int(i) = 0; (i) < (n); (i)++) {
    int leaves = 0;
    for (int v : g[i]) {
      if (deg[v] == 1) ++leaves;
    }
    if (leaves >= 2) res -= leaves - 1;
  }
  cout << res << endl;
  return 0;
}
