#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:134217728")
using namespace std;
int n;
vector<int> G[1 << 18];
int dp1[1 << 18][2];
int dp2[1 << 18][2];
int cnt[1 << 18];
int go1(int x, int d) {
  if (G[x].empty()) return 1;
  int& res = dp1[x][d];
  if (res != -1) return res;
  if (d) {
    res = 0;
    for (int i = 0; i < G[x].size(); ++i) res += go1(G[x][i], d ^ 1);
    res -= G[x].size();
    res++;
  } else {
    res = -(int)1e9;
    for (int i = 0; i < G[x].size(); ++i)
      res = max(res, (cnt[x] - cnt[G[x][i]]) + go1(G[x][i], d ^ 1));
  }
  return res;
}
int go2(int x, int d) {
  if (G[x].empty()) return 1;
  int& res = dp2[x][d];
  if (res != -1) return res;
  if (!d) {
    res = 0;
    for (int i = 0; i < G[x].size(); ++i) res += go2(G[x][i], d ^ 1);
  } else {
    res = (int)1e9;
    for (int i = 0; i < G[x].size(); ++i) res = min(res, go2(G[x][i], d ^ 1));
  }
  return res;
}
void dfs(int x) {
  cnt[x] = G[x].empty();
  for (int i = 0; i < G[x].size(); ++i) {
    dfs(G[x][i]);
    cnt[x] += cnt[G[x][i]];
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--, v--;
    G[u].push_back(v);
  }
  dfs(0);
  memset(dp1, -1, sizeof(dp1));
  memset(dp2, -1, sizeof(dp2));
  printf("%d %d\n", go1(0, 0), go2(0, 0));
  return 0;
}
