#include <bits/stdc++.h>
using namespace std;
int n, root, mx, mn;
vector<int> tree[100005];
int dfs(int c, int p) {
  int e = 0, o = 0, tot = 0;
  for (auto& a : tree[c]) {
    if (a != p) {
      int t = dfs(a, c);
      o += t % 2;
      e += (t + 1) % 2;
      tot = t + 1;
    }
  }
  if (o && e) mn = 3;
  if (tree[c].size() == 1) return 0;
  return tot;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    tree[a - 1].push_back(b - 1);
    tree[b - 1].push_back(a - 1);
  }
  for (int i = 0; i < n; i++)
    if (tree[i].size() - 1) root = i;
  mn = 1;
  mx = n - 1;
  for (int i = 0; i < n; i++) {
    int leaf = 0;
    for (auto& a : tree[i])
      if (tree[a].size() == 1) leaf++;
    mx -= max(leaf - 1, 0);
  }
  dfs(root, root);
  cout << mn << " " << mx << endl;
}
