#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
vector<int> dpm(N), dpM(N);
vector<int> g[N];
int l[N];
void init(int u, int p = -1) {
  if (g[u].size() == 1 && g[u][0] == p)
    l[u] = 1;
  else {
    for (int v : g[u]) {
      if (v != p) {
        init(v, u);
        l[u] += l[v];
      }
    }
  }
}
void dfs1(int u, int p = -1, bool turn = true) {
  if (g[u].size() == 1 && g[u][0] == p) {
    dpM[u] = 1;
    return;
  }
  for (int v : g[u])
    if (v != p) dfs1(v, u, !turn);
  if (turn) {
    int lsum = 0;
    for (int v : g[u])
      if (v != p) lsum += l[v];
    for (int v : g[u]) {
      if (v != p) {
        dpM[u] = max(dpM[u], dpM[v] + lsum - l[v]);
      }
    }
  } else {
    int tsum = 0;
    for (int v : g[u])
      if (v != p) tsum += l[v] - dpM[v] + 1;
    --tsum;
    dpM[u] = l[u] - tsum;
  }
}
void dfs2(int u, int p = -1, bool turn = true) {
  if (g[u].size() == 1 && g[u][0] == p) {
    dpm[u] = 1;
    return;
  }
  for (int v : g[u])
    if (v != p) dfs2(v, u, !turn);
  if (turn) {
    int tsum = 0;
    for (int v : g[u])
      if (v != p) tsum += dpm[v];
    dpm[u] = tsum;
  } else {
    dpm[u] = 10000000;
    for (int v : g[u]) {
      if (v != p) {
        dpm[u] = min(dpm[u], dpm[v]);
      }
    }
  }
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  if (n == 1) {
    cout << "1 1\n";
    return 0;
  }
  init(1);
  dfs1(1);
  dfs2(1);
  cout << dpM[1] << ' ' << dpm[1] << '\n';
}
