#include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int> > g;
vector<int> s;
vector<int> b1, b2, c1, c2;
void dfs(int v) {
  if (g[v].empty()) {
    s[v] = b1[v] = b2[v] = c1[v] = c2[v] = 1;
    return;
  }
  for (int u : g[v]) {
    dfs(u);
    s[v] += s[u];
  }
  c2[v] = s[v];
  for (int u : g[v]) {
    b1[v] = max(b1[v], s[v] - s[u] + b2[u]);
    b2[v] += b1[u] - 1;
    c1[v] += c2[u];
    c2[v] = min(c2[v], c1[u]);
  }
  b2[v]++;
}
int main() {
  cin >> n;
  g = vector<vector<int> >(n);
  for (int i = 0; i < (int)(n - 1); i++) {
    int v, u;
    cin >> v >> u;
    g[v - 1].push_back(u - 1);
  }
  s = vector<int>(n);
  b1 = vector<int>(n);
  b2 = vector<int>(n);
  c1 = vector<int>(n);
  c2 = vector<int>(n);
  dfs(0);
  cout << b1[0] << " " << c1[0] << endl;
  return 0;
}
