#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O2,no-stack-protector,unroll-loops,fast-math")
const long long maxn = 2e5 + 10, maxm = 2e3 + 10, lg = 18, mod = 1e9 + 7,
                inf = 1e18;
long long n, m, dp[maxn][2];
vector<long long> g[maxn];
void dfs(long long v = 1) {
  if (g[v].empty()) return void(m += dp[v][0] = dp[v][1] = 1);
  dp[v][0] = inf;
  for (auto u : g[v]) {
    dfs(u);
    dp[v][0] = min(dp[v][0], dp[u][1]);
    dp[v][1] += dp[u][0];
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    long long v, u;
    cin >> v >> u;
    g[v].push_back(u);
  }
  dfs();
  cout << m + 1 - dp[1][0] << ' ' << dp[1][1];
  return 0;
}
