#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 7;
inline int R() {
  int rt;
  scanf("%d", &rt);
  return rt;
}
vector<int> e[MAXN];
int dp[MAXN][2], cnt, t[2];
void Dfs1(int nf, int nd) {
  if (!e[nf].size()) {
    dp[nf][1] = 1;
    return;
  }
  if (nd)
    dp[nf][1] = 1e9;
  else
    dp[nf][0] = 1e9;
  for (auto to : e[nf]) {
    Dfs1(to, nd ^ 1);
    t[0] = dp[nf][0], t[1] = dp[nf][1];
    if (nd)
      t[1] = min(t[1], min(t[1], t[0]) + dp[to][1]), t[0] = t[0] + dp[to][0];
    else
      t[0] = min(t[0], min(t[0], t[1]) + dp[to][0]), t[1] = t[1] + dp[to][1];
    dp[nf][0] = t[0], dp[nf][1] = t[1];
  }
}
void Dfs2(int nf, int nd) {
  if (!e[nf].size()) {
    dp[nf][0] = 1;
    return;
  }
  if (nd)
    dp[nf][1] = 1e9;
  else
    dp[nf][0] = 1e9;
  for (auto to : e[nf]) {
    Dfs2(to, nd ^ 1);
    t[0] = dp[nf][0], t[1] = dp[nf][1];
    if (nd)
      t[1] = min(t[1], min(t[1], t[0]) + dp[to][1]), t[0] = t[0] + dp[to][0];
    else
      t[0] = min(t[0], min(t[0], t[1]) + dp[to][0]), t[1] = t[1] + dp[to][1];
    dp[nf][0] = t[0], dp[nf][1] = t[1];
  }
}
int main() {
  int n = R();
  for (int i = 1; i < n; ++i) {
    int u = R(), v = R();
    e[u].push_back(v);
  }
  int cnt = 0;
  for (int i = 1; i <= n; ++i) cnt += (e[i].size() == 0);
  Dfs1(1, 1);
  printf("%d ", cnt - dp[1][1] + 1);
  memset(dp, 0, sizeof dp);
  Dfs2(1, 1);
  printf("%d\n", dp[1][0]);
  return 0;
}
