#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
const long long mod = 1e9 + 7;
const int maxn = 1e6 + 5;
int n;
vector<int> g[maxn];
int depth[maxn];
void dfs2(int at, int p, int d = 0) {
  depth[at] = d;
  for (int to : g[at]) {
    if (to == p) continue;
    dfs2(to, at, d + 1);
  }
}
int dfs(int at, int p = 0) {
  int leaves = 0;
  int nonleaf = 0;
  int rec = 0;
  for (int to : g[at]) {
    if (to == p) continue;
    if ((int)g[to].size() == 1) {
      leaves++;
    } else {
      nonleaf++;
      rec += dfs(to, at);
    }
  }
  return min(leaves, 1) + nonleaf + rec;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int r = 1;
  while ((int)g[r].size() == 1) r++;
  assert(r <= n);
  int mx = dfs(r);
  dfs2(r, 0);
  set<int> ss;
  for (int i = 1; i <= n; i++) {
    if ((int)g[i].size() == 1) {
      ss.insert(depth[i] % 2);
    }
  }
  int mn = (int)ss.size() == 1 ? 1 : 3;
  cout << mn << " " << mx << endl;
  return 0;
}
