#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
vector<int> g[N];
int f[N][2], leafs[N];
void dfs(int v, int p, bool turn) {
  vector<int> childs;
  for (int i = 0; i < g[v].size(); i++) {
    int u = g[v][i];
    if (u != p) {
      dfs(u, v, turn ^ 1);
      childs.push_back(u);
      leafs[v] += leafs[u];
    }
  }
  if (childs.empty()) {
    leafs[v] = 1;
    return;
  }
  if (turn == 0) {
    int minDrMax = N, sumDrMin = 0;
    for (int i = 0; i < childs.size(); i++) {
      int u = childs[i];
      int drMax = leafs[u] - 1 - f[u][0], drMin = leafs[u] - 1 - f[u][1];
      minDrMax = min(drMax, minDrMax);
      sumDrMin += drMin;
    }
    f[v][0] = leafs[v] - 1 - minDrMax;
    f[v][1] = leafs[v] - 1 - sumDrMin;
  } else {
    int minDlMin = N, sumDlMax = 0;
    for (int i = 0; i < childs.size(); i++) {
      int u = childs[i];
      int dlMax = f[u][0], dlMin = f[u][1];
      minDlMin = min(dlMin, minDlMin);
      sumDlMax += dlMax;
    }
    f[v][0] = sumDlMax;
    f[v][1] = minDlMin;
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int v, u;
    cin >> v >> u;
    v--, u--;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  dfs(0, -1, 0);
  cout << f[0][0] + 1 << ' ' << f[0][1] + 1 << endl;
  return 0;
}
