#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T = 1;
  while (T--) {
    long long n;
    cin >> n;
    vector<vector<long long> > adj(n + 1);
    long long r = -1;
    for (long long i = 0; i < n - 1; i++) {
      long long a, b;
      cin >> a >> b;
      adj[a].push_back(b);
      adj[b].push_back(a);
      if (adj[a].size() >= 2) {
        r = a;
      }
      if (adj[b].size() >= 2) {
        r = b;
      }
    }
    long long mx = n - 1, mn = INT_MAX;
    queue<pair<long long, long long> > q;
    q.push({r, 0});
    vector<long long> l;
    vector<long long> vis(n + 1, 0);
    vis[r] = 1;
    while (!q.empty()) {
      pair<long long, long long> t;
      t = q.front();
      q.pop();
      long long c = 0;
      for (auto i : adj[t.first]) {
        if (adj[i].size() == 1) {
          l.push_back(t.second + 1);
          c++;
        } else if (!vis[i])
          q.push({i, t.second + 1}), vis[i] = 1;
      }
      if (c > 0) mx -= (c - 1);
    }
    long long f1 = 0, f2 = 0;
    for (long long i = 0; i < l.size(); i++) {
      if (l[i] % 2)
        f1 = 1;
      else
        f2 = 1;
    }
    if (f1 && f2)
      mn = 3;
    else
      mn = 1;
    cout << mn << " " << mx;
  }
  return 0;
}
