#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, a, b;
  cin >> n;
  vector<long long int> adj[n];
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    adj[a - 1].push_back(b - 1);
    adj[b - 1].push_back(a - 1);
  }
  long long int mmin, mmax;
  long long int root = -1;
  for (int i = 0; i < n; i++) {
    if (adj[i].size() == 1) {
      root = i;
      break;
    }
  }
  vector<long long int> dist(n);
  queue<long long int> que;
  vector<bool> marked(n);
  vector<long long int> parent(n);
  que.push(root);
  marked[root] = true;
  dist[root] = 0;
  parent[root] = -1;
  while (!que.empty()) {
    long long int x = que.front();
    que.pop();
    for (auto b : adj[x]) {
      if (!marked[b]) {
        que.push(b);
        dist[b] = dist[x] + 1;
        parent[b] = x;
        marked[b] = true;
      }
    }
  }
  long long int edges = n - 1;
  long long int n_leaves = 0;
  long long int n_leaf_par = 0;
  set<long long int> leaf_par;
  bool all_leaf_even = true;
  long long int root_par = 0;
  for (int i = 0; i < n; i++) {
    if (adj[i].size() == 1) {
      n_leaves++;
      leaf_par.insert(parent[i]);
      if (dist[i] % 2 == 1) all_leaf_even = false;
    }
  }
  leaf_par.erase(-1);
  leaf_par.insert(adj[root][0]);
  n_leaf_par = leaf_par.size();
  if (all_leaf_even)
    mmin = 1;
  else
    mmin = 3;
  mmax = edges - n_leaves + n_leaf_par;
  cout << mmin << " " << mmax << endl;
}
