#include <bits/stdc++.h>
using namespace std;
int n, m, f[200010][2];
vector<int> e[200010];
inline void dfs(int u) {
  f[u][0] = 1e9 + 7;
  if (e[u].empty()) {
    m++;
    f[u][0] = f[u][1] = 1;
    return;
  }
  for (int i = 0; i < e[u].size(); i++) {
    int v = e[u][i];
    dfs(v);
    f[u][0] = min(f[u][0], f[v][1]);
    f[u][1] += f[v][0];
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1, x, y; i < n; i++) {
    scanf("%d%d", &x, &y);
    e[x].push_back(y);
  }
  dfs(1);
  printf("%d %d", m - f[1][0] + 1, f[1][1]);
  return 0;
}
