#include <bits/stdc++.h>
using namespace std;
int n, p[200010], a[400010], nxt[400010], f[200010], tot, deep[200010], leaf;
void add(int x, int y) {
  tot++;
  a[tot] = y;
  nxt[tot] = p[x];
  p[x] = tot;
}
void dfs_A(int u, int fa) {
  int Min = n + 1, sum = 0;
  deep[u] = deep[fa] + 1;
  f[u] = 1;
  for (int i = p[u]; i != 0; i = nxt[i])
    if (a[i] != fa) {
      dfs_A(a[i], u);
      Min = min(Min, f[a[i]]);
      sum = sum + f[a[i]];
    }
  if (Min == n + 1) {
    leaf++;
    return;
  }
  if (deep[u] & 1)
    f[u] = Min;
  else
    f[u] = sum;
}
void dfs_B(int u, int fa) {
  int Min = n + 1, sum = 0;
  f[u] = 1;
  for (int i = p[u]; i != 0; i = nxt[i])
    if (a[i] != fa) {
      dfs_B(a[i], u);
      Min = min(Min, f[a[i]]);
      sum = sum + f[a[i]];
    }
  if (Min == n + 1) return;
  if (deep[u] & 1)
    f[u] = sum;
  else
    f[u] = Min;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  dfs_A(1, 0);
  printf("%d ", leaf - f[1] + 1);
  memset(f, 0, sizeof(f));
  dfs_B(1, 0);
  printf("%d\n", f[1]);
  return 0;
}
