#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> adj[200020];
int f1[200020], f2[200020];
void go(int par, int u, int level) {
  if (adj[u].size() == 0) {
    f1[u] = f2[u] = 1;
    m++;
  } else
    f1[u] = f2[u] = 0;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v != par) {
      go(u, v, level + 1);
      if (level & 1) {
        f1[u] += f1[v];
        f2[u] = !f2[u] ? f2[v] : min(f2[u], f2[v]);
      } else {
        f2[u] += f2[v];
        f1[u] = !f1[u] ? f1[v] : min(f1[u], f1[v]);
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
  }
  m = 0;
  go(0, 1, 1);
  cout << m - f2[1] + 1 << " " << f1[1] << endl;
  return 0;
}
