#include <bits/stdc++.h>
using namespace std;
vector<int> G[200010];
bool isleaf[200010];
int dp[200010];
void dfs1(int u) {
  int sz = G[u].size();
  if (!sz) isleaf[u] = 1;
  for (int i = 0; i < sz; i++) {
    int v = G[u][i];
    dfs1(v);
  }
}
int d = 0;
void dfs(int u) {
  if (isleaf[u]) {
    dp[u] = 1;
    return;
  }
  d++;
  dp[u] = (d & 1) ? 0x3FFFFFFF : 0;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    dfs(v);
    if (d & 1)
      dp[u] = min(dp[v], dp[u]);
    else
      dp[u] += dp[v];
  }
  d--;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int u, v;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    G[u].push_back(v);
  }
  dfs1(1);
  int num = 0;
  for (int i = 1; i <= n; i++) {
    if (isleaf[i]) num++;
  }
  dfs(1);
  cout << num - dp[1] + 1 << " ";
  d = 1;
  dfs(1);
  cout << dp[1] << endl;
  ;
  return 0;
}
