#include <bits/stdc++.h>
using namespace std;
const int nmax = 2e5;
const int inf = 1 << 30;
vector<int> g[nmax + 1];
int sz[nmax + 1];
int d[nmax + 1][2];
void dfs_max(int nod, int h) {
  for (auto i : g[nod]) dfs_max(i, h + 1);
  sz[nod] = 0;
  for (auto i : g[nod]) sz[nod] += sz[i];
  if (sz[nod] == 0) sz[nod] = 1;
  d[nod][0] = d[nod][1] = 0;
  if (h % 2 == 0) {
    d[nod][0] = sz[nod] - 1;
    for (auto i : g[nod]) d[nod][0] = min(d[nod][0], sz[i] - d[i][1]);
    d[nod][0] = sz[nod] - d[nod][0];
  } else {
    for (auto i : g[nod]) d[nod][1] += (d[i][0] - 1);
    ++d[nod][1];
  }
}
void dfs_min(int nod, int h) {
  for (auto i : g[nod]) dfs_min(i, h + 1);
  d[nod][0] = d[nod][1] = 0;
  if (h % 2 == 0) {
    for (auto i : g[nod]) d[nod][0] += d[i][1];
    if (d[nod][0] == 0) ++d[nod][0];
  } else {
    d[nod][1] = 1 << 30;
    for (auto i : g[nod]) d[nod][1] = min(d[nod][1], d[i][0]);
    if (d[nod][1] == 1 << 30) d[nod][1] = 1;
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int x, y;
    fscanf(stdin, "%d%d", &x, &y);
    g[x].push_back(y);
  }
  dfs_max(1, 0);
  fprintf(stdout, "%d ", d[1][0]);
  dfs_min(1, 0);
  fprintf(stdout, "%d\n", d[1][0]);
  return 0;
}
