#include <bits/stdc++.h>
using namespace std;
const long long N = 200777;
long long n;
long long dp1[N];
long long dp2[N];
vector<long long> g[N];
long long deep[N];
long long inf = 1e9;
long long m = 0;
void dfs1(long long v, long long pr) {
  deep[v] = deep[pr] + 1;
  if (deep[v] % 2 == 1) {
    bool fl = 0;
    dp1[v] = inf;
    for (long long i = 0; i < g[v].size(); i++) {
      long long to = g[v][i];
      if (to != pr) {
        fl = 1;
        dfs1(to, v);
        dp1[v] = min(dp1[v], dp1[to]);
      }
    }
    if (!fl) {
      dp1[v] = 1;
    }
  } else {
    dp1[v] = 0;
    bool fl = 0;
    for (long long i = 0; i < g[v].size(); i++) {
      long long to = g[v][i];
      if (to != pr) {
        fl = 1;
        dfs1(to, v);
        dp1[v] = dp1[v] + dp1[to];
      }
    }
    if (!fl) {
      dp1[v] = 1;
    }
  }
}
void dfs2(long long v, long long pr) {
  if (deep[v] % 2 == 1) {
    bool fl = 0;
    dp2[v] = 0;
    for (long long i = 0; i < g[v].size(); i++) {
      long long to = g[v][i];
      if (pr != to) {
        fl = 1;
        dfs2(to, v);
        dp2[v] += dp2[to];
      }
    }
    if (!fl) {
      dp2[v] = 1;
    }
  } else {
    bool fl = 0;
    dp2[v] = inf;
    for (long long i = 0; i < g[v].size(); i++) {
      long long to = g[v][i];
      if (pr != to) {
        fl = 1;
        dfs2(to, v);
        dp2[v] = min(dp2[v], dp2[to]);
      }
    }
    if (!fl) {
      dp2[v] = 1;
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  if (n == 1) {
    cout << "1 1"
         << "\n";
    return 0;
  }
  for (long long i = 1; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (long long i = 2; i <= n; i++) {
    if (g[i].size() == 1) {
      m++;
    }
  }
  dfs1(1, 0);
  dfs2(1, 0);
  cout << m - dp1[1] + 1 << " " << dp2[1] << "\n";
  return 0;
}
