#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long n, siz[N], mx[N], mn[N];
vector<long long> adj[N];
void dfs(long long node) {
  if (adj[node].empty()) {
    siz[node] = mx[node] = mn[node] = 1;
    return;
  }
  for (auto &v : adj[node]) {
    dfs(v);
    siz[node] += siz[v];
    mx[node] = min(mx[node], mn[v]);
    mn[node] += mx[v];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  memset(mx, 0x3f, sizeof(mx));
  for (long long i = 1; i <= n - 1; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v);
  }
  dfs(1);
  cout << siz[1] - mx[1] + 1 << " " << mn[1];
}
