#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
int n, m, d[MAXN], dp[MAXN], r1, r2;
vector<int> adj[MAXN];
void dfs(int v, int depth) {
  int len = adj[v].size(), u;
  dp[v] = 0;
  if (len == 0) return;
  if (depth & 1) {
    dp[v] = -m;
  } else {
    dp[v] = 0;
  }
  for (int i = 0; i < len; i++) {
    u = adj[v][i];
    dfs(u, depth + 1);
    if (depth & 1) {
      dp[v] = max(dp[v], dp[u]);
    } else {
      dp[v] += dp[u];
    }
  }
  if (!(depth & 1)) {
    dp[v] -= (len - 1);
  }
}
void dfs2(int v, int depth) {
  int len = adj[v].size(), u;
  dp[v] = 0;
  if (len == 0) return;
  if (depth & 1) {
    dp[v] = 0;
  } else {
    dp[v] = m;
  }
  for (int i = 0; i < len; i++) {
    u = adj[v][i];
    dfs2(u, depth + 1);
    if (depth & 1) {
      dp[v] += dp[u];
    } else {
      dp[v] = min(dp[v], dp[u]);
    }
  }
  if (depth & 1) {
    dp[v] += (len - 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int v, u;
    scanf("%d%d", &v, &u);
    adj[v].push_back(u);
    d[v]++;
  }
  for (int i = 1; i <= n; i++)
    if (d[i] == 0) m++;
  dfs(1, 1);
  r1 = m + dp[1];
  memset(dp, 0, sizeof(dp));
  dfs2(1, 1);
  r2 = 1 + dp[1];
  printf("%d %d\n", r1, r2);
  return 0;
}
