#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int N = 2e5 + 7;
vector<int> e[N];
int f[N], g[N];
int sum = 0;
void dfs(int u, int fa, int s) {
  bool fg = 0;
  if (s == 0)
    g[u] = MOD, f[u] = 0;
  else
    g[u] = 0, f[u] = MOD;
  for (int v : e[u]) {
    if (v == fa) continue;
    fg = 1;
    dfs(v, u, s ^ 1);
    if (s == 0) {
      g[u] = min(g[u], g[v]);
      f[u] += f[v];
    } else {
      g[u] += g[v];
      f[u] = min(f[u], f[v]);
    }
  }
  if (!fg) {
    sum++;
    g[u] = 1;
    f[u] = 1;
  }
}
int main() {
  int n, u, v;
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    scanf("%d%d", &u, &v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfs(1, 0, 0);
  cout << sum - g[1] + 1 << " " << f[1] << endl;
}
