#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> adj[n + 1];
  for (long long i = 0; i < n - 1; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  vector<bool> lf(n + 1);
  long long lfc = 0, start = INT_MAX;
  for (long long i = 1; i <= n; i++) {
    if (adj[i].size() == 1) {
      start = min(start, i);
      lfc++;
      lf[i] = 1;
    }
  }
  long long mn = 1, mx = n - 1;
  vector<long long> d(n + 1, -1);
  queue<long long> q;
  q.push(start);
  d[start] = 0;
  while (!q.empty()) {
    long long u = q.front();
    q.pop();
    long long cnt = 0;
    for (long long i = 0; i < adj[u].size(); i++) {
      long long v = adj[u][i];
      if (lf[v]) cnt++;
      if (d[v] == -1) {
        d[v] = d[u] + 1;
        q.push(v);
      }
    }
    if (cnt >= 2) mx -= (cnt - 1);
  }
  for (long long i = 1; i <= n; i++)
    if (lf[i] and d[i] % 2 == 1 and d[i] > 1) mn = 3;
  cout << mn << ' ' << mx << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int qu = 1;
  for (int cas = 1; cas <= qu; cas++) {
    solve();
  }
}
