#include <bits/stdc++.h>
const int N = 200010;
std::vector<int> G[N];
int dfs(int u, int f) {
  if (!G[u].size()) return 1;
  if (f) {
    int min = N;
    for (int &v : G[u]) min = std::min(min, dfs(v, 0));
    return min;
  } else {
    int ret = 0;
    for (int &v : G[u]) ret += dfs(v, 1);
    return ret;
  }
}
int main() {
  int n, u, v;
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &u, &v);
    u--;
    v--;
    G[u].push_back(v);
  }
  int leaves = 0;
  for (int i = 0; i < n; i++)
    if (!G[i].size()) leaves++;
  printf("%d %d\n", leaves - dfs(0, 1) + 1, dfs(0, 0));
  return 0;
}
