#include <bits/stdc++.h>
using namespace std;
int ind[100005], dp = -1, flag1;
vector<int> g[100005];
map<int, int> mp;
void dfs(int u, int dep, int fa) {
  for (int i = 0; i < g[u].size(); i++) {
    int j = g[u][i];
    if (j == fa) continue;
    dfs(j, dep + 1, u);
  }
  if (g[u].size() == 1) {
    mp[fa]++;
    if (dp == -1) {
      if (dep % 2)
        dp = 1;
      else
        dp = 0;
    }
    if (dp != -1) {
      if ((dep % 2) && !dp)
        flag1 = 1;
      else if (((dep % 2) == 0) && (dp == 1))
        flag1 = 1;
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1, a, b; i < n; i++) {
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
    ind[a]++;
    ind[b]++;
  }
  int rt;
  for (int i = 1; i <= n; i++)
    if (ind[i] != 1) {
      rt = i;
      break;
    }
  dfs(rt, 0, -1);
  int res = n - 1;
  for (int i = 1; i <= n; i++)
    if (mp[i]) res -= (mp[i] - 1);
  cout << (flag1 == 1 ? 3 : 1) << " " << res << endl;
  return 0;
}
