#include <bits/stdc++.h>
using namespace std;
const int N = 200002;
int n, dpth[N], w[N], dp[2][N];
vector<vector<int> > g;
void dfs(int u) {
  if (g[u].empty()) {
    w[u] = 1;
    return;
  }
  w[u] = 0;
  for (int i = 0; i < g[u].size(); i++) {
    dpth[g[u][i]] = dpth[u] + 1;
    dfs(g[u][i]);
    w[u] += w[g[u][i]];
  }
}
int calc(int u, int c) {
  if (g[u].empty()) return 1;
  int &r = dp[c][u];
  if (r != -1) return r;
  if ((dpth[u] % 2 == 1 && c == 0) || (dpth[u] % 2 == 0 && c == 1)) {
    r = 0;
    for (int i = 0; i < g[u].size(); i++) r += calc(g[u][i], c);
  } else {
    r = 1e9;
    for (int i = 0; i < g[u].size(); i++) r = min(r, calc(g[u][i], c));
  }
  return r;
}
int main() {
  std::ios::sync_with_stdio(false);
  scanf("%d", &n);
  g.resize(n);
  memset(dp, -1, sizeof(dp));
  for (int i = 1, a, b; i < n; i++) {
    scanf("%d%d", &a, &b);
    a--, b--;
    g[a].push_back(b);
  }
  dpth[0] = 0;
  dfs(0);
  printf("%d %d\n", w[0] - (calc(0, 0) - 1), calc(0, 1));
  return 0;
}
