#include <bits/stdc++.h>
using namespace std;
vector<int> node[200005];
int cnt[200005];
int n, m;
int dfs(int parent) {
  if (node[parent].size() == 0) {
    cnt[parent] = 1;
    return 1;
  } else {
    for (int i = 0; i < (node[parent].size()); i++)
      cnt[parent] += dfs(node[parent][i]);
    return cnt[parent];
  }
}
int min(int x, int y) { return x < y ? x : y; }
int fun(int p, bool f) {
  if (node[p].size() == 0) {
    return 1;
  } else {
    if (f) {
      int r = 0;
      for (int i = 0; i < (node[p].size()); i++) {
        int t = fun(node[p][i], !f);
        if (r < cnt[p] - cnt[node[p][i]] + t) r = cnt[p] - cnt[node[p][i]] + t;
      }
      return r;
    } else {
      int r = 0;
      for (int i = 0; i < (node[p].size()); i++) {
        int t = fun(node[p][i], !f);
        r += t - 1;
      }
      return r + 1;
    }
  }
}
int main() {
  while (scanf("%d", &n) != EOF) {
    int a, b;
    for (int i = 0; i < (200005); i++) node[i].clear(), cnt[i] = 0;
    for (int i = 0; i < (n - 1); i++)
      scanf("%d %d", &a, &b), node[a].push_back(b);
    m = dfs(1);
    printf("%d %d\n", fun(1, true), m + 1 - fun(1, false));
  }
  return 0;
}
