#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 7;
const long long mod = 1e9 + 7;
long long read() {
  long long res = 0;
  long long f = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (isdigit(c)) res = (res << 1) + (res << 3) + c - 48, c = getchar();
  return res * f;
}
struct node {
  int to, nt;
} e[maxn];
int cnt, head[maxn];
void add(int x, int y) {
  cnt++;
  e[cnt].to = y;
  e[cnt].nt = head[x];
  head[x] = cnt;
}
int du[maxn];
int n, tot;
int dfs(int x, bool bl) {
  if (!du[x]) return 1;
  int r1 = 0, r2 = n + 1;
  for (int i = head[x]; i; i = e[i].nt) {
    int to = e[i].to;
    if (bl)
      r1 += dfs(to, 0);
    else
      r2 = min(r2, dfs(to, 1));
  }
  return bl ? r1 : r2;
}
int main() {
  n = read();
  for (int i = 1; i < n; i++) {
    int x = read(), y = read();
    add(x, y);
    du[x]++;
  }
  for (int i = 1; i <= n; i++) {
    if (!du[i]) tot++;
  }
  printf("%d %d\n", tot + 1 - dfs(1, 0), dfs(1, 1));
  return 0;
}
