#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int maxint = 0x3f3f3f3f;
const int mod = 1e9 + 7;
int n, m;
vector<int> v[maxn];
int dfs(int x, int len) {
  if (v[x].size() == 0) {
    m++;
    return 1;
  }
  int mi = n + 1, s = 0;
  for (int i = 0; i < v[x].size(); i++) {
    if (len % 2)
      s += dfs(v[x][i], len + 1);
    else
      mi = min(mi, dfs(v[x][i], len + 1));
  }
  if (len % 2)
    return s;
  else
    return mi;
}
int main() {
  int i, x, y;
  cin >> n;
  for (i = 1; i < n; i++) {
    cin >> x >> y;
    v[x].push_back(y);
  }
  cout << m + 1 - dfs(1, 0) << " " << dfs(1, 1) << "\n";
  return 0;
}
