#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
vector<int> g[maxn];
int dep[maxn], du[maxn], qko[maxn];
int n;
int u, v, root;
vector<int> leaf;
void dfs(int x, int par, int d) {
  dep[x] = d;
  if (g[x].size() == 1) {
    leaf.push_back(d);
    qko[par]++;
  }
  for (int son : g[x]) {
    if (son != par) {
      dfs(son, x, d + 1);
    }
  }
}
int r1, r2;
int main() {
  cin >> n;
  r1 = 1, r2 = n - 1;
  for (int i = 1; i <= n - 1; i++) {
    cin >> u >> v;
    du[u]++, du[v]++;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= n; i++)
    if (du[i] > 1) {
      root = i;
      dfs(i, -1, 0);
      break;
    }
  sort(leaf.begin(), leaf.end());
  for (int i = 0; i <= (int)leaf.size() - 2; i++) {
    if ((leaf[i + 1] - leaf[i]) & 1) {
      r1 = 3;
      break;
    }
  }
  for (int i = 1; i <= n; i++)
    if (qko[i] > 1) r2 -= qko[i] - 1;
  cout << r1 << " " << r2 << "\n";
}
