#include <bits/stdc++.h>
using namespace std;
int n;
const int maxN = 1e5 + 3;
vector<int> g[maxN];
vector<int> dfs(int v, int par, bool& good, int& sub) {
  bool even = false, odd = false;
  vector<int> rr;
  int to_sub = 0;
  for (int ne : g[v]) {
    if (ne == par) {
      continue;
    }
    vector<int> r = dfs(ne, v, good, sub);
    for (int e : r) {
      if (e % 2) {
        odd = true;
      } else {
        even = true;
      }
      if (e == 0) {
        to_sub++;
      }
      rr.push_back(e + 1);
    }
  }
  if (to_sub) {
    sub += to_sub - 1;
  }
  if (odd && even) {
    good = true;
  }
  if (rr.empty()) {
    rr.push_back(0);
  }
  return rr;
}
int main() {
  cin >> n;
  int start;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    g[u].push_back(v);
    g[v].push_back(u);
    if (g[u].size() > 1) {
      start = u;
    }
    if (g[v].size() > 1) {
      start = v;
    }
  }
  bool has_odd = false;
  int sub = 0;
  dfs(start, -1, has_odd, sub);
  int cnt = n - 1 - sub;
  if (has_odd) {
    cout << 3 << ' ' << max(3, cnt) << '\n';
  } else {
    cout << 1 << ' ' << cnt << '\n';
  }
  return 0;
}
