#include <bits/stdc++.h>
using namespace std;
vector<int> G[200100];
int solve(int idx, int dist) {
  if (G[idx].size() == 0) {
    return 1;
  }
  if (dist % 2 == 0) {
    int minimum = 2 * 200100;
    for (int i = 0; i < (int)G[idx].size(); i++) {
      minimum = min(minimum, solve(G[idx][i], dist + 1));
    }
    return minimum;
  }
  int ret = 0;
  for (int i = 0; i < (int)G[idx].size(); i++) {
    ret += solve(G[idx][i], dist + 1);
  }
  return ret;
}
int solve2(int idx, int dist) {
  if (G[idx].size() == 0) return 1;
  if (dist % 2 == 1) {
    int minimum = 2 * 200100;
    for (int i = 0; i < (int)G[idx].size(); i++) {
      minimum = min(minimum, solve2(G[idx][i], dist + 1));
    }
    return minimum;
  }
  int ret = 0;
  for (int i = 0; i < (int)G[idx].size(); i++) {
    ret += solve2(G[idx][i], dist + 1);
  }
  return ret;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    G[u].push_back(v);
  }
  int m = 0;
  for (int i = 1; i <= n; i++) {
    if (G[i].size() == 0) m++;
  }
  int r1 = solve(1, 0);
  int r2 = solve2(1, 0);
  printf("%d %d\n", m - r1 + 1, r2);
  return 0;
}
