#include <bits/stdc++.h>
using namespace std;
const int max_N = 200000 + 20;
int h[max_N], maxx[max_N], minn[max_N], l[max_N];
vector<int> adj[max_N];
void initialize(int v) {
  if (adj[v].size() == 0) l[v] = 1;
  for (int i = 0; i < (int)adj[v].size(); i++) {
    initialize(adj[v][i]);
    l[v] += l[adj[v][i]];
  }
}
void dfs(int v) {
  if (adj[v].size() == 0) {
    maxx[v] = 1;
    minn[v] = 1;
  }
  for (int i = 0; i < (int)adj[v].size(); i++) {
    int u = adj[v][i];
    h[u] = 1 - h[v];
    dfs(u);
    if (!h[v]) {
      maxx[v] = max(maxx[v], maxx[u] + (l[v] - l[u]));
      minn[v] += minn[u] - 1;
    } else {
      maxx[v] += maxx[u] - 1;
      if (minn[v] == 0)
        minn[v] = minn[u];
      else
        minn[v] = min(minn[v], minn[u]);
    }
  }
  if (h[v] && (int)adj[v].size() > 0) maxx[v]++;
  if (!h[v] && (int)adj[v].size() > 0) minn[v] += adj[v].size();
}
int main() {
  int n, u, v, m(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
  }
  for (int i = 0; i < n; i++) {
    if (adj[i].size() == 0) m++;
  }
  initialize(0), dfs(0);
  cout << maxx[0] << ' ' << minn[0];
  return 0;
}
