#include <bits/stdc++.h>
using namespace std;
const long long int Maxn = 2e5 + 5, N = 4e5 + 5, Mod = 1e9 + 7, Inf = 1e18,
                    Log = 22;
int n, h[Maxn], r, mx;
vector<int> adj[Maxn];
bool mrk[Maxn];
bool flg[2];
void Dfs(int v, int p) {
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (u == p) continue;
    h[u] = h[v] + 1;
    if (adj[u].size() == 1) {
      if (h[u] & 1) {
        flg[0] = 1;
      } else {
        flg[1] = 1;
      }
    }
    Dfs(u, v);
  }
  return;
}
void DFs(int v, int p) {
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (u == p) continue;
    if (adj[u].size() == 1) {
      mrk[v] = 1;
      mx--;
      continue;
    }
    DFs(u, v);
  }
  mx += mrk[v];
  return;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
    if (1 < adj[v].size())
      r = v;
    else if (1 < adj[u].size())
      r = u;
  }
  Dfs(r, -1);
  if (flg[0] && flg[1])
    cout << 3 << ' ';
  else
    cout << 1 << ' ';
  DFs(r, -1);
  cout << n - 1 + mx << '\n';
  return 0;
}
