#include <bits/stdc++.h>
inline long long read() {
  char c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  long long k = 0, kk = 1;
  if (c == '-') c = getchar(), kk = -1;
  while (c >= '0' && c <= '9') k = k * 10 + c - '0', c = getchar();
  return k * kk;
}
void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x / 10) write(x / 10);
  putchar(x % 10 + '0');
}
void writeln(long long x) {
  write(x);
  puts("");
}
using namespace std;
long long n, x, y, a[1000010][2], last[1000010], d[1000010], mi[1000010],
    ma[1000010], rd[1000010], kk;
void dfs(long long x, long long de, long long fa) {
  if (rd[x] == 1 && fa || rd[x] == 0) {
    d[x] = mi[x] = ma[x] = 1;
    return;
  }
  long long xx, yy;
  if (de & 1)
    xx = 0, yy = 1e15;
  else
    xx = 1e15, yy = 0;
  for (long long i = last[x]; i; i = a[i][0])
    if (a[i][1] != fa) {
      dfs(a[i][1], de + 1, x);
      d[x] += d[a[i][1]];
      if (de & 1)
        xx += mi[a[i][1]], yy = min(yy, d[a[i][1]] - ma[a[i][1]]);
      else
        xx = min(xx, mi[a[i][1]]), yy += ma[a[i][1]] - 1;
    }
  if (de & 1) {
    mi[x] = xx;
    ma[x] = d[x] - yy;
  } else {
    mi[x] = xx;
    ma[x] = yy + 1;
  }
}
void doit(long long x, long long y) {
  a[++kk][0] = last[x];
  a[kk][1] = y;
  last[x] = kk;
  rd[x]++;
}
signed main() {
  n = read();
  for (long long i = 1; i < n; i++)
    x = read(), y = read(), doit(x, y), doit(y, x);
  dfs(1, 1, 0);
  write(ma[1]);
  putchar(' ');
  writeln(mi[1]);
}
