#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5;
vector<int> to[MAXN];
int mn_ones(int u, int pppppppprev, bool we) {
  int i, v;
  if (pppppppprev != -1 && to[u].size() == 1) return 1;
  int ret = (we ? 2e9 : 0);
  for (i = 0; i < to[u].size(); ++i) {
    v = to[u][i];
    if (v == pppppppprev) continue;
    ret = we ? min(ret, mn_ones(v, u, !we)) : ret + mn_ones(v, u, !we);
  }
  return ret;
}
void run() {
  int n, m, i, u, v;
  scanf("%d", &n);
  if (n == 1) {
    printf("1 1\n");
    return;
  }
  for (i = 0; i < n - 1; ++i) {
    scanf("%d%d", &u, &v);
    --u;
    --v;
    to[u].push_back(v);
    to[v].push_back(u);
  }
  m = 0;
  for (u = 1; u < n; ++u) m += (u != 0 && to[u].size() == 1);
  int mx = 0;
  for (i = 0; i < to[0].size(); ++i) {
    v = to[0][i];
    mx = max(mx, m - mn_ones(v, 0, false) + 1);
  }
  int mn = mn_ones(0, -1, false);
  printf("%d %d\n", mx, mn);
}
int main() {
  run();
  return 0;
}
