#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, dep[N], deg[N], f[N];
int head[N], numE = 1;
struct E {
  int next, v;
} e[N << 1];
int find(int x) { return x == f[x] ? x : f[x] = find(f[x]); }
void inline add(int u, int v) {
  e[++numE] = (E){head[u], v};
  head[u] = numE;
}
void dfs(int u, int fa) {
  for (int i = head[u]; i; i = e[i].next) {
    int v = e[i].v;
    if (v == fa) continue;
    dep[v] = dep[u] + 1;
    dfs(v, u);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1, u, v; i < n; i++) {
    f[i] = i;
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
    deg[u]++, deg[v]++;
  }
  dfs(1, 0);
  int L = 1;
  bool c0 = false, c1 = false;
  for (int i = 1; i <= n; i++) {
    if (deg[i] == 1) {
      if (dep[i] & 1)
        c1 = true;
      else
        c0 = true;
    }
  }
  if (c1 && c0) L = 3;
  printf("%d ", L);
  for (int u = 1; u <= n; u++) {
    int last = 0;
    for (int i = head[u]; i; i = e[i].next) {
      int v = e[i].v;
      if (deg[v] == 1) {
        if (!last)
          last = i >> 1;
        else
          f[find(last)] = find(i >> 1);
      }
    }
  }
  int R = 0;
  for (int i = 1; i < n; i++) {
    if (find(i) == i) R++;
  }
  printf("%d\n", R);
  return 0;
}
