#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
template <typename T>
void read(T &x) {
  x = 0;
  int f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + c - '0';
  x *= f;
}
int n, rt;
int head[N], cnt;
int dep[N], f[N], du[N];
bool isleaf[N], visodd, viseven;
struct Edge {
  int to, next;
} e[N << 1];
void add(int x, int y) { e[++cnt] = (Edge){y, head[x]}, head[x] = cnt; }
void dfs(int u, int fa) {
  dep[u] = dep[fa] + 1;
  int lfcnt = 0;
  for (int i = head[u]; ~i; i = e[i].next) {
    int v = e[i].to;
    if (v == fa) continue;
    if (isleaf[v]) {
      lfcnt++, dep[v] = dep[u] + 1;
      continue;
    }
    dfs(v, u);
    f[u] += f[v] + 1;
  }
  if (lfcnt) f[u]++;
}
int main() {
  memset(head, -1, sizeof(head));
  read(n);
  for (int i = 1; i <= n - 1; i++) {
    int x, y;
    read(x), read(y);
    add(x, y), add(y, x);
    du[x]++, du[y]++;
  }
  for (int i = 1; i <= n; i++)
    if (du[i] > 1) {
      rt = i;
      break;
    }
  for (int i = 1; i <= n; i++)
    if (du[i] == 1) isleaf[i] = true;
  dfs(rt, 0);
  for (int i = 1; i <= n; i++)
    if (isleaf[i]) {
      if (dep[i] & 1)
        visodd = true;
      else
        viseven = true;
    }
  if (visodd && viseven)
    printf("3 ");
  else
    printf("1 ");
  printf("%d\n", f[rt]);
  return 0;
}
