#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> edge[200010];
int dp[200010][2][2];
int leaf[200010];
void dfsLeaf(int u) {
  if (edge[u].size() == 0) {
    leaf[u] = 1;
    return;
  }
  for (int i = 0; i < edge[u].size(); ++i) {
    int v = edge[u][i];
    dfsLeaf(v);
    leaf[u] += leaf[v];
  }
}
void dfsDp(int u) {
  if (edge[u].size() == 0) {
    dp[u][0][1] = dp[u][1][0] = dp[u][0][0] = dp[u][1][1] = 1;
    return;
  }
  dp[u][0][0] = 0;
  dp[u][0][1] = 0;
  dp[u][1][0] = 1;
  dp[u][1][1] = 1000000000;
  for (int i = 0; i < edge[u].size(); ++i) {
    int v = edge[u][i];
    dfsDp(v);
    dp[u][0][0] = max(dp[u][0][0], dp[v][1][0] + leaf[u] - leaf[v]);
    dp[u][0][1] += dp[v][1][1];
    dp[u][1][0] += dp[v][0][0] - 1;
    dp[u][1][1] = min(dp[u][1][1], dp[v][0][1]);
  }
}
int main() {
  int u, v;
  while (cin >> n) {
    for (int i = 1; i < n; ++i) {
      cin >> u >> v;
      edge[u].push_back(v);
    }
    memset(leaf, 0, sizeof(leaf));
    dfsLeaf(1);
    dfsDp(1);
    cout << dp[1][0][0] << " " << dp[1][0][1] << endl;
  }
  return 0;
}
