#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
int N, M0[MAXN], M1[MAXN], L;
vector<int> children[MAXN];
void dfs(int u, int len) {
  if (len % 2 == 0) {
    M1[u] = MAXN;
  } else {
    M0[u] = MAXN;
  }
  for (int i = 0; i < ((int)children[u].size()); i++) {
    int v = children[u][i];
    dfs(v, len + 1);
    if (len % 2 == 0) {
      M0[u] += M0[v];
      M1[u] = min(M1[v], M1[u]);
    } else {
      M0[u] = min(M0[v], M0[u]);
      M1[u] += M1[v];
    }
  }
  if (((int)children[u].size()) == 0) {
    M0[u] = 1;
    M1[u] = 1;
    ++L;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> N;
  for (int i = 0; i < N - 1; i++) {
    int u, v;
    cin >> u >> v;
    --u;
    --v;
    children[u].push_back(v);
  }
  dfs(0, 0);
  int res1 = L - M1[0] + 1;
  int res2 = M0[0];
  cout << res1 << ' ' << res2 << '\n';
  return 0;
}
