#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int N = 2e5 + 10;
int n, x, y, lv[N], c[N];
int f[N];
vector<int> a[N];
void DFS1(int par, int x) {
  if (a[x].size() == (par > 0)) {
    f[x] = c[x] = 1;
    return;
  }
  if (lv[x] % 2 == 0) f[x] = inf;
  for (auto y : a[x])
    if (y != par) {
      lv[y] = lv[x] + 1;
      DFS1(x, y);
      c[x] += c[y];
      if (lv[x] % 2)
        f[x] += f[y];
      else
        f[x] = min(f[x], f[y]);
    }
}
void DFS2(int par, int x) {
  if (a[x].size() == (par > 0)) {
    f[x] = 1;
    return;
  }
  if (lv[x] % 2) f[x] = inf;
  for (auto y : a[x])
    if (y != par) {
      DFS2(x, y);
      if (lv[x] % 2)
        f[x] = min(f[x], f[y]);
      else
        f[x] += f[y];
    }
}
void solve() {
  DFS1(0, 1);
  printf("%d ", c[1] - f[1] + 1);
  memset(f, 0, sizeof(f));
  DFS2(0, 1);
  printf("%d", f[1]);
}
int main() {
  scanf("%d", &n);
  for (auto i = 1; i <= n - 1; i++) {
    scanf("%d%d", &x, &y);
    a[x].push_back(y);
    a[y].push_back(x);
  }
  solve();
}
