#include <bits/stdc++.h>
using namespace std;
int n, cnt, f[500005], g[500005];
vector<int> son[500005];
void dfs(int x) {
  if (son[x].size() == 0) {
    ++cnt, f[x] = g[x] = 1;
    return;
  }
  f[x] = 0x3f3f3f3f;
  for (auto y : son[x]) dfs(y), f[x] = min(f[x], g[y]), g[x] += f[y];
}
int main() {
  cin >> n;
  for (int x, y, i = 1; i < n; ++i) cin >> x >> y, son[x].push_back(y);
  dfs(1);
  cout << cnt - f[1] + 1 << ' ' << g[1] << endl;
  return 0;
}
