#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long mn = 2e5;
long long n, a, b, mini = 1, maxi, root, k1[mn], k2[mn];
vector<long long> v[mn];
void dfs(long long i, long long pr = -1) {
  long long cnt = 0;
  for (long long j : v[i])
    if (j != pr) {
      if (v[j].size() == 1)
        cnt++;
      else {
        dfs(j, i);
        k1[i] += k2[j];
        k2[i] += k1[j];
      }
    }
  k1[i] += cnt;
  if (k1[i] > 0 && k2[i] > 0) mini = 3;
  maxi -= max(0ll, cnt - 1);
}
signed main() {
  iostream::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long i = 1; i < n; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (long long i = 1; i <= n; i++) {
    if (v[i].size() > 1) root = i;
  }
  maxi = n - 1;
  dfs(root);
  cout << mini << " " << maxi;
  return 0;
}
