#include <bits/stdc++.h>
using namespace std;
int n, u, e, d[200005], mp[200005], x, y, m, k;
vector<int> v[200005], v1, v2;
void solve(int a, int l) {
  d[a] = d[l] + 1;
  if (v[a].size() == 1) {
    v1.push_back(a);
    mp[a] = 1;
  } else {
    v2.push_back(a);
  }
  for (int i = 0; i < v[a].size(); i++) {
    if (v[a][i] != l) {
      solve(v[a][i], a);
    }
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    cin >> u >> e;
    v[u].push_back(e);
    v[e].push_back(u);
  }
  solve(1, 0);
  x = 1;
  for (int i = 1; i < v1.size(); i++) {
    if (d[v1[i - 1]] % 2 != d[v1[i]] % 2) {
      x = 3;
      break;
    }
  }
  for (int i = 0; i < v2.size(); i++) {
    y = v2[i];
    for (int j = 0; j < v[y].size(); j++) {
      if (mp[v[y][j]] == 1) {
        k++;
        break;
      }
    }
  }
  cout << x << " " << n - 1 - v1.size() + k;
}
