#include <bits/stdc++.h>
using namespace std;
vector<long long> v[200000];
long long vis[200000], z = 0;
vector<long long> k;
void dfs(long long x, long long y) {
  long long t = 0;
  if (v[x].size() == 1) k.push_back(y);
  vis[x] = 1;
  for (long long i = 0; i < v[x].size(); i++) {
    if (v[x][i] == 1 && v[1].size() == 1) t++;
    if (vis[v[x][i]] == 0) {
      if (v[v[x][i]].size() == 1) t++;
      dfs(v[x][i], y + 1);
    }
  }
  if (t > 0) z++;
}
signed main() {
  ios_base::sync_with_stdio(false);
  long long n, x, y, m = 0;
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (long long i = 1; i < n + 1; i++) vis[i] = 0;
  dfs(1, 0);
  for (long long i = 1; i < k.size(); i++) {
    if (k[i - 1] % 2 != k[i] % 2) {
      m++;
      break;
    }
  }
  if (m > 0)
    cout << 3 << " ";
  else
    cout << 1 << " ";
  cout << (n - 1) - k.size() + z;
}
