#include <bits/stdc++.h>
using namespace std;
const int N = 200020;
int nex[N * 2], head[N], to[N * 2];
int n, cnt;
void add(int x, int y) {
  nex[++cnt] = head[x];
  head[x] = cnt;
  to[cnt] = y;
}
int dfs(int u, bool flag) {
  if (!head[u]) return 1;
  int ret1 = 0, ret2 = n + 1;
  for (int i = head[u]; i; i = nex[i]) {
    int v = to[i];
    if (flag)
      ret1 += dfs(v, 0);
    else
      ret2 = min(ret2, dfs(v, 1));
  }
  return flag ? ret1 : ret2;
}
int main() {
  scanf("%d", &n);
  int x, y, m = 0;
  for (int i = 1; i < n; i++) scanf("%d%d", &x, &y), add(x, y);
  for (int i = 1; i <= n; i++)
    if (!head[i]) m++;
  printf("%d %d\n", m + 1 - dfs(1, 0), dfs(1, 1));
  return 0;
}
