#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, cnt_edge, ans = 1;
int head[maxn], deg[maxn];
bool f[maxn][2];
struct edge {
  int to, nxt;
} e[maxn << 1];
inline int read() {
  char c = getchar();
  int res = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') res = res * 10 + c - '0', c = getchar();
  return res * f;
}
inline void add_edge(int u, int v) {
  e[++cnt_edge].nxt = head[u];
  head[u] = cnt_edge;
  e[cnt_edge].to = v;
}
void dfs1(int x, int fa) {
  if (!e[head[x]].nxt) f[x][0] = 1;
  for (int i = head[x]; i; i = e[i].nxt) {
    int y = e[i].to;
    if (y == fa) continue;
    dfs1(y, x);
    if (f[x][0] && f[y][0]) ans = 3;
    if (f[x][1] && f[y][1]) ans = 3;
    f[x][0] |= f[y][1], f[x][1] |= f[y][0];
  }
}
void dfs2(int x, int fa) {
  if (!e[head[x]].nxt) {
    if (x == 1)
      deg[e[head[x]].to]++;
    else {
      deg[fa]++;
      return;
    }
  }
  for (int i = head[x]; i; i = e[i].nxt)
    if (e[i].to != fa) dfs2(e[i].to, x);
}
int main() {
  n = read();
  for (int i = 1; i < n; i++) {
    int u = read(), v = read();
    add_edge(u, v);
    add_edge(v, u);
  }
  dfs1(1, 0);
  printf("%d ", ans);
  ans = n - 1;
  dfs2(1, 0);
  for (int i = 1; i <= n; i++)
    if (deg[i]) ans -= deg[i] - 1;
  printf("%d", ans);
  return 0;
}
