#include <bits/stdc++.h>
using namespace std;
const int MAXN = 222222;
vector<int> G[MAXN];
bool isLeaf[MAXN];
bool isFirst[MAXN];
int valueRank[MAXN];
int n, m;
int dfs(int fa, int u, int step) {
  isFirst[u] = !(step & 1);
  if (G[u].size() == 0) {
    valueRank[u] = 1;
  } else {
    valueRank[u] = isFirst[u] ? INT_MAX : 0;
    for (auto v : G[u]) {
      if (v == fa) continue;
      dfs(u, v, step + 1);
      if (isFirst[u]) {
        valueRank[u] = min(valueRank[u], valueRank[v]);
      } else {
        valueRank[u] += valueRank[v];
      }
    }
  }
  return valueRank[u];
}
int main() {
  while (scanf("%d", &n) != EOF) {
    memset(isFirst, 0, sizeof(isFirst));
    memset(isLeaf, 0, sizeof(isLeaf));
    for (int i = 0; i < n; ++i) {
      G[i].clear();
    }
    for (int i = 0; i < n - 1; ++i) {
      int a, b;
      scanf("%d %d", &a, &b);
      --a, --b;
      G[a].push_back(b);
    }
    m = 0;
    for (int i = 0; i < n; ++i) {
      if (G[i].size() == 0) {
        ++m;
      }
    }
    printf("%d %d\n", m - dfs(-1, 0, 0) + 1, dfs(-1, 0, 1));
  }
}
