#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, mn[N][2], m;
vector<int> e[N];
void dfs(int u, int fa) {
  int Mn = n + 1, Ad = 0;
  for (int v : e[u]) {
    if (v == fa) continue;
    dfs(v, u);
    Mn = min(Mn, mn[v][1]), Ad += mn[v][0];
  }
  mn[u][0] = Mn, mn[u][1] = Ad;
  if ((u != 1 && e[u].size() == 1) || e[u].size() == 0)
    mn[u][0] = mn[u][1] = 1, m++;
}
int main() {
  scanf("%d", &n);
  for (int i = 1, u, v; i < n; i++) {
    scanf("%d%d", &u, &v);
    e[u].push_back(v), e[v].push_back(u);
  }
  dfs(1, 0);
  printf("%d %d", m - mn[1][0] + 1, mn[1][1]);
  return 0;
}
