#include <bits/stdc++.h>
using namespace std;
vector<int> vec[200005];
int min(int a, int b) { return a < b ? a : b; }
int dfs1(int u, int k) {
  if (vec[u].size() == 0) return 1;
  int ans = 200005, sum = 0, tmp, i, v;
  for (i = 0; i != vec[u].size(); i++) {
    v = vec[u][i];
    tmp = dfs1(v, k ^ 1);
    ans = min(tmp, ans);
    sum += tmp;
  }
  if (k) return ans;
  return sum;
}
int dfs2(int u, int k) {
  if (vec[u].size() == 0) return 1;
  int sum = 0, tmp, i, v, ans = 200005;
  for (i = 0; i != vec[u].size(); i++) {
    v = vec[u][i];
    tmp = dfs2(v, k ^ 1);
    ans = min(tmp, ans);
    sum += tmp;
  }
  if (k) return sum;
  return ans;
}
int main() {
  int n, a, b, i, m;
  while (scanf("%d", &n) != EOF) {
    for (i = 1; i <= n; i++) vec[i].clear();
    for (i = 0; i < n - 1; i++) {
      scanf("%d%d", &a, &b);
      vec[a].push_back(b);
    }
    for (m = 0, i = 1; i <= n; i++)
      if (!vec[i].size()) m++;
    printf("%d %d\n", m + 1 - dfs1(1, 1), dfs2(1, 1));
  }
  return 0;
}
