#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
const int INF = 1000000000;
const long long Mod = 1000000007;
int sz[N], dp[N], n;
vector<int> edge[N];
void dfs1(int u, int k) {
  int K = edge[u].size();
  if (K == 0) {
    sz[u] = 1;
    dp[u] = 0;
    return;
  }
  sz[u] = 0;
  int sum = 0;
  for (int i = 0; i < K; i++) {
    int v = edge[u][i];
    dfs1(v, k ^ 1);
    sz[u] += sz[v];
    sum += dp[v];
  }
  if (k == 1) {
    int tot = sz[u];
    dp[u] = 0;
    for (int i = 0; i < K; i++) {
      int v = edge[u][i];
      dp[u] = max(dp[u], tot - sz[v] + dp[v]);
    }
  } else {
    dp[u] = sum;
  }
}
void dfs2(int u, int k) {
  int K = edge[u].size();
  if (K == 0) {
    sz[u] = 1;
    dp[u] = 0;
    return;
  }
  sz[u] = 0;
  int sum = 0;
  for (int i = 0; i < K; i++) {
    int v = edge[u][i];
    dfs2(v, k ^ 1);
    sz[u] += sz[v];
    sum += dp[v] + 1;
  }
  if (k == 1) {
    dp[u] = sum - 1;
  } else {
    dp[u] = sz[u] - 1;
    for (int i = 0; i < K; i++) {
      int v = edge[u][i];
      dp[u] = min(dp[u], dp[v]);
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    edge[x].push_back(y);
  }
  dfs1(1, 1);
  printf("%d ", dp[1] + 1);
  dfs2(1, 1);
  printf("%d\n", dp[1] + 1);
  return 0;
}
