#include <bits/stdc++.h>
using namespace std;
int t1, t2, tot;
int n, cnt;
int head[210000], nex[210000 * 2], to[210000 * 2];
int f[210000], g[210000], son[210000], bj[210000];
void add(int x, int y) {
  tot++;
  nex[tot] = head[x];
  head[x] = tot;
  to[tot] = y;
}
void dfs1(int x, int y, int deep) {
  g[x] = bj[x];
  f[x] = 1 << 30;
  for (int i = head[x]; i; i = nex[i])
    if (to[i] != y) {
      dfs1(to[i], x, deep + 1);
      if (deep & 1)
        f[x] = min(f[x], g[to[i]]);
      else
        g[x] += f[to[i]];
    }
  if (f[x] == 1 << 30) f[x] = 1;
}
void dfs2(int x, int y, int deep) {
  g[x] = bj[x];
  f[x] = 1 << 30;
  for (int i = head[x]; i; i = nex[i])
    if (to[i] != y) {
      dfs2(to[i], x, deep + 1);
      if (!(deep & 1))
        f[x] = min(f[x], g[to[i]]);
      else
        g[x] += f[to[i]];
    }
  if (f[x] == 1 << 30) f[x] = 1;
}
int main() {
  scanf("%d", &n);
  if (n == 1) {
    puts("1 1");
    return 0;
  }
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &t1, &t2);
    add(t1, t2);
    add(t2, t1);
    son[t1]++;
  }
  for (int i = 1; i <= n; i++)
    if (!son[i]) bj[i] = 1, cnt++;
  dfs1(1, 0, 1);
  printf("%d ", cnt - f[1] + 1);
  memset(g, 0, sizeof(g));
  dfs2(1, 0, 1);
  printf("%d\n", g[1]);
  return 0;
}
