#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 4;
int dp_max[N];
int dp_min[N];
vector<int> g[N];
int w;
void dfs(int u) {
  if (g[u].size() == 0) {
    w++;
    dp_max[u] = 1;
    dp_min[u] = 1;
    return;
  } else {
    int sm = 0;
    dp_max[u] = N;
    for (int i = 0; i < g[u].size(); i++) {
      int v = g[u][i];
      dfs(v);
      dp_max[u] = min(dp_max[u], dp_min[v]);
      dp_min[u] += dp_max[v];
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    g[u].push_back(v);
  }
  dfs(1);
  int ans1 = w - dp_max[1] + 1;
  int ans2 = dp_min[1];
  printf("%d %d\n", ans1, ans2);
  return 0;
}
