#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
const long long inf = 0x7fffffff;
const long long mod = 1e9 + 7;
const double eps = 1e-6;
long long head[N], nxt[N], to[N], tot = 0;
void add(long long u, long long v) {
  nxt[++tot] = head[u];
  to[tot] = v;
  head[u] = tot;
}
long long du[N], deep[N];
long long fg1 = 0, fg2 = 0;
long long tmp[N];
void dfs(long long x, long long y) {
  if (x != y) deep[x] = deep[y] + 1;
  if (du[x] == 1) {
    if (deep[x] & 1)
      fg1 = 1;
    else
      fg2 = 1;
    tmp[y]++;
    return;
  }
  for (long long i = head[x]; i; i = nxt[i]) {
    if (to[i] != y) {
      dfs(to[i], x);
    }
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  for (long long i = 1; i <= n - 1; i++) {
    long long u, v;
    cin >> u >> v;
    add(u, v);
    add(v, u);
    du[u]++;
    du[v]++;
  }
  long long root;
  for (long long i = 1; i <= n; i++) {
    if (du[i] != 1) {
      root = i;
      break;
    }
  }
  dfs(root, root);
  if (fg1 + fg2 == 1)
    cout << 1 << ' ';
  else
    cout << 3 << ' ';
  long long near = 0;
  for (long long i = 1; i <= n; i++) {
    if (tmp[i] != 0) {
      near += tmp[i] - 1;
    }
  }
  cout << n - near - 1 << '\n';
}
