#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
vector<int> g[maxn];
int n, c;
int mx[maxn], mn[maxn], leaf[maxn];
void DP(int x, int ismx) {
  if (!g[x].size()) {
    leaf[x] = 1;
    mx[x] = mn[x] = 1;
    c++;
    return;
  }
  if (ismx) {
    mn[x] = 0;
    mx[x] = 0x3f3f3f3f;
  } else {
    mn[x] = 0x3f3f3f3f;
    mx[x] = 0;
  }
  for (int i = 0; i < g[x].size(); i++) {
    int to = g[x][i];
    DP(to, !ismx);
    if (ismx) {
      mx[x] = min(mx[x], mx[to]);
      mn[x] += mn[to];
    } else {
      mx[x] += mx[to];
      mn[x] = min(mn[x], mn[to]);
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].emplace_back(v);
  }
  DP(1, 1);
  printf("%d %d\n", c + 1 - mx[1], mn[1]);
  return 0;
}
