#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, w = 1;
  char ch = 0;
  while (ch > '9' || ch < '0') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * w;
}
const int N = 3e5 + 5;
struct edge {
  int next, to;
} a[N << 1];
int head[N], cnt;
inline void add(int u, int v) {
  a[++cnt].to = v;
  a[cnt].next = head[u];
  head[u] = cnt;
}
int n, ans1, ans2;
int deg[N], dep[N], flag[2];
int f[N];
int find(int x) { return (x == f[x]) ? x : f[x] = find(f[x]); }
inline void link(int x, int y) {
  x = find(x), y = find(y);
  f[x] = y;
}
void dfs(int x, int fa) {
  dep[x] = dep[fa] + 1;
  if (deg[x] == 1) flag[dep[x] & 1] = 1;
  int las = 0;
  for (int i = head[x]; i; i = a[i].next) {
    int y = a[i].to;
    if (y == fa) continue;
    if (deg[y] == 1 && las) link(las, y);
    if (deg[y] == 1) las = y;
    dfs(y, x);
  }
}
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) f[i] = i;
  for (int i = 1; i < n; ++i) {
    int u = read(), v = read();
    ++deg[u], ++deg[v];
    add(u, v), add(v, u);
  }
  for (int i = 1; i <= n; ++i)
    if (deg[i] != 1) {
      dfs(i, 0);
      for (int j = 1; j <= n; ++j)
        if (i != j && find(j) == j) ++ans2;
      break;
    }
  if (flag[1] & flag[0])
    ans1 = 3;
  else
    ans1 = 1;
  printf("%d %d\n", ans1, ans2);
  return 0;
}
