#include <bits/stdc++.h>
using namespace std;
vector<int> G[2 * 100 * 1000 + 5];
vector<int> dpMax, dpMin, leaves;
void dfs(int node, int l) {
  if (G[node].empty()) {
    dpMax[node] = dpMin[node] = leaves[node] = 1;
    return;
  }
  for (auto v : G[node]) dfs(v, 1 - l);
  int sum = 0, sum2 = 0, minn = 3e5, gminn = 3e5;
  for (auto v : G[node]) {
    leaves[node] += leaves[v];
    sum += leaves[v] - dpMax[v] + 1;
    sum2 += leaves[v] - dpMin[v];
    minn = min(minn, leaves[v] - dpMax[v]);
    gminn = min(gminn, dpMin[v]);
  }
  if (l == 0) {
    dpMax[node] = leaves[node] - minn;
    dpMin[node] = leaves[node] - sum2;
  } else {
    dpMax[node] = leaves[node] - (sum - 1);
    dpMin[node] = gminn;
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int a, b;
    cin >> a >> b;
    G[a].push_back(b);
  }
  dpMax = vector<int>(n + 1, 0);
  dpMin = vector<int>(n + 1, 0);
  leaves = vector<int>(n + 1, 0);
  dfs(1, 0);
  cout << dpMax[1] << " " << dpMin[1] << "\n";
}
