#include <bits/stdc++.h>
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
using namespace std;
const int MAXN = 210000;
int n, m, ans[MAXN][2];
vector<int> T[MAXN];
void dfs(int u) {
  if (T[u].empty()) {
    m++;
    ans[u][0] = ans[u][1] = 1;
    return;
  }
  ans[u][0] = MAXN;
  for (int v : T[u]) {
    dfs(v);
    ans[u][0] = min(ans[u][0], ans[v][1]);
    ans[u][1] += ans[v][0];
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    T[u].push_back(v);
  }
  dfs(1);
  cout << m - ans[1][0] + 1 << " " << ans[1][1] << endl;
  return 0;
}
