#include <bits/stdc++.h>
using namespace std;
vector<long long> adj[100005];
long long n;
bool mn = false;
long long mx;
bool dfs(long long s, long long p) {
  long long sz = adj[s].size();
  if (sz == 1) {
    return true;
  }
  int ans = -1;
  for (long long i = 0; i < sz; i++) {
    long long v = adj[s][i];
    if (v != p) {
      if (ans == -1)
        ans = dfs(v, s);
      else {
        int Ans = dfs(v, s);
        if (ans != Ans) mn = true;
      }
    }
  }
  return (1 - ans);
}
void dfs2(long long s, long long p) {
  long long sz = adj[s].size();
  if (sz == 1) {
    return;
  }
  long long ans = 0;
  for (long long i = 0; i < sz; i++) {
    long long v = adj[s][i];
    if (v != p) {
      long long sz2 = adj[v].size();
      if (sz2 == 1)
        ans++;
      else
        dfs2(v, s);
    }
  }
  if (ans > 1) mx -= (ans - 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  long long M = n - 1;
  long long a, b;
  while (M--) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  long long s;
  for (long long i = 1; i <= n; i++) {
    long long sz = adj[i].size();
    if (sz > 1) {
      s = i;
      break;
    }
  }
  dfs(s, 0);
  if (mn)
    cout << 3 << " ";
  else
    cout << 1 << " ";
  mx = n - 1;
  dfs2(s, 0);
  cout << mx;
}
