#include <bits/stdc++.h>
using namespace std;
int n, m, ans;
vector<int> chd[200005];
int cnt_leaf[200005];
void dfs_cnt(int u) {
  cnt_leaf[u] = (chd[u].size() == 0);
  for (int i = 0; i < chd[u].size(); ++i) {
    int v = chd[u][i];
    dfs_cnt(v), cnt_leaf[u] += cnt_leaf[v];
  }
}
int dfs(int u, bool turn) {
  int sz = chd[u].size();
  int ret = 1;
  if (turn == 0) {
    for (int i = 0; i < sz; ++i) {
      int v = chd[u][i];
      int tmp = dfs(v, turn ^ 1);
      ret = max(ret, cnt_leaf[u] - cnt_leaf[v] + tmp);
    }
  } else {
    int add = 0;
    for (int i = 0; i < sz; ++i) {
      int v = chd[u][i];
      int tmp = dfs(v, turn ^ 1);
      add += tmp - 1;
    }
    ret = add + 1;
  }
  return ret;
}
int dfs2(int u, bool turn) {
  int sz = chd[u].size();
  int ret = cnt_leaf[u];
  if (turn == 1) {
    for (int i = 0; i < sz; ++i) {
      int v = chd[u][i];
      int tmp = dfs2(v, turn ^ 1);
      ret = min(ret, tmp);
    }
  } else {
    int add = 0;
    for (int i = 0; i < sz; ++i) {
      int v = chd[u][i];
      int tmp = dfs2(v, turn ^ 1);
      add += cnt_leaf[v] - tmp;
    }
    ret = cnt_leaf[u] - add;
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    chd[u].push_back(v);
  }
  dfs_cnt(1);
  printf("%d %d", dfs(1, 0), dfs2(1, 0));
}
