#include <bits/stdc++.h>
using namespace std;
long long int n;
long long int deg[100005];
vector<long long int> a[100005];
long long int minn;
bool dfs(long long int node, long long int par, long long int odd) {
  for (auto i : a[node]) {
    if (i != par) {
      if (deg[i] == 1 and odd) {
        minn = 3;
        return 1;
      }
      if (dfs(i, node, 1 - odd)) return 1;
    }
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int i, j;
  cin >> n;
  memset(deg, 0, sizeof deg);
  for (i = 0; i < n - 1; i++) {
    long long int u, v;
    cin >> u >> v;
    deg[u]++;
    deg[v]++;
    a[u].push_back(v);
    a[v].push_back(u);
  }
  long long int maxx = n - 1, leaf;
  minn = 1;
  for (i = 1; i <= n; i++) {
    long long int cnt = 0;
    for (auto it : a[i]) {
      if (deg[it] == 1) {
        leaf = it;
        cnt++;
      }
    }
    if (cnt > 1) maxx -= (cnt - 1);
  }
  if (dfs(leaf, 0, 1)) minn = 3;
  cout << minn << " " << maxx;
  return 0;
}
