#include <bits/stdc++.h>
using namespace std;
int cnt = 0;
vector<vector<int> > T;
vector<int> L;
void dfs1(int u, int par) {
  int here = 0;
  if (par == -1)
    L[u] = 0;
  else
    L[u] = L[par] + 1;
  for (int v : T[u]) {
    if (v != par) {
      here += T[v].size() == 1;
      dfs1(v, u);
    }
  }
  cnt -= max(here - 1, 0);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  T.resize(n);
  L.resize(n);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    T[u].push_back(v);
    T[v].push_back(u);
  }
  int rt = -1;
  for (int i = 0; i < n; i++) {
    if (T[i].size() > 1) {
      rt = i;
      break;
    }
  }
  dfs1(rt, -1);
  int mx_ans = n - 1 + cnt;
  int g = -1;
  int mn_ans = 1;
  for (int i = 0; i < n; i++) {
    if (T[i].size() > 1) continue;
    if (g != -1) {
      if (g != L[i] % 2) {
        mn_ans = 3;
      }
    } else {
      g = L[i] % 2;
    }
  }
  cout << mn_ans << ' ' << mx_ans << '\n';
  return 0;
}
