#include <bits/stdc++.h>
using namespace std;
struct edge {
  int y, ne;
} e[500005];
int tot, h[200005], n;
void Addedge(int x, int y) {
  e[++tot].y = y;
  e[tot].ne = h[x];
  h[x] = tot;
}
int dfs(int x, int k) {
  if (!h[x]) return 1;
  int t1 = 500000, t2 = 0;
  for (int i = h[x]; i; i = e[i].ne)
    if (k)
      t2 += dfs(e[i].y, k ^ 1);
    else
      t1 = min(t1, dfs(e[i].y, k ^ 1));
  if (k) return t2;
  return t1;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    Addedge(x, y);
  }
  int l = 0;
  for (int i = 1; i <= n; i++)
    if (!h[i]) l++;
  cout << l + 1 - dfs(1, 0) << " " << dfs(1, 1) << endl;
  return 0;
}
