#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 10;
const int MN = 2e5 + 10;
int dp_max[MN], dp_min[MN];
int sz[MN], leaf[MN];
int h[MN];
int n;
vector<int> adj[MN];
void dfs(int s, int pr) {
  int Mx = 1, Mn = 0, deg = 0, mymn = INF, mn = INF;
  for (auto v : adj[s])
    if (v != pr) {
      ++deg;
      h[v] = h[s] + 1;
      dfs(v, s);
      sz[s] += sz[v], leaf[s] += leaf[v];
      if (h[s] & 1) {
        Mx += dp_max[v] - 1;
        mn = min(mn, dp_min[v]);
      } else {
        Mn += dp_min[v];
        mymn = min(mymn, leaf[v] - dp_max[v]);
      }
    }
  if (!deg) {
    dp_min[s] = dp_max[s] = leaf[s] = 1;
    return;
  }
  if (h[s] & 1) {
    dp_max[s] = Mx;
    dp_min[s] = mn;
  } else {
    dp_min[s] = Mn;
    dp_max[s] = leaf[s] - mymn;
  }
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    adj[a].push_back(b), adj[b].push_back(a);
  }
  dfs(0, -1);
  cout << dp_max[0] << ' ' << dp_min[0] << endl;
  return 0;
}
