#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> V[300000 + 20];
int f[300000 + 20];
void minimize(int &a, int b) {
  if (a > b) a = b;
}
void dfs(int u, int h, int last, int large) {
  bool is_leaf = true;
  for (int i = 0; i < V[u].size(); i++) {
    int v = V[u][i];
    if (v == last) continue;
    is_leaf = false;
  }
  if (is_leaf) {
    f[u] = 1;
    m++;
    return;
  }
  if ((h % 2 == 1 && large == 1) || (h % 2 == 0 && large == 0)) {
    f[u] = n;
    for (int i = 0; i < V[u].size(); i++) {
      int v = V[u][i];
      if (v == last) continue;
      dfs(v, h + 1, u, large);
      minimize(f[u], f[v]);
    }
  }
  if ((h % 2 == 0 && large == 1) || (h % 2 == 1 && large == 0)) {
    f[u] = 0;
    for (int i = 0; i < V[u].size(); i++) {
      int v = V[u][i];
      if (v == last) continue;
      dfs(v, h + 1, u, large);
      f[u] += f[v];
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    V[a].push_back(b);
    V[b].push_back(a);
  }
  dfs(1, 1, 0, 1);
  printf("%d", m - f[1] + 1);
  m = 0;
  memset(f, 0, sizeof f);
  dfs(1, 1, 0, 0);
  printf(" %d", f[1]);
}
