#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
vector<int> G[N];
int dp[N][2];
int sz[N];
void dfs(int u, int dep) {
  if (G[u].empty()) {
    sz[u] = 1;
    dp[u][0] = dp[u][1] = 1;
    return;
  }
  if (dep & 1) {
    dp[u][0] = 0x3f3f3f3f;
    dp[u][1] = G[u].size() - 1;
  } else {
    dp[u][1] = 0x3f3f3f3f;
    dp[u][0] = 0;
  }
  for (int i = 0; i < (int)G[u].size(); ++i) {
    int v = G[u][i];
    dfs(v, dep + 1);
    sz[u] += sz[v];
    if (dep & 1) {
      dp[u][1] += sz[v] - dp[v][1];
      dp[u][0] = min(dp[u][0], dp[v][0]);
    } else {
      dp[u][1] = min(dp[u][1], sz[v] - dp[v][1]);
      dp[u][0] += dp[v][0];
    }
  }
  dp[u][1] = sz[u] - dp[u][1];
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
  }
  dfs(1, 0);
  printf("%d %d\n", dp[1][1], dp[1][0]);
  return 0;
}
