#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void amin(T &a, const T &b) {
  if (a > b) a = b;
}
template <class T>
inline void amax(T &a, const T &b) {
  if (a < b) a = b;
}
const int MAX = 200011;
int N;
vector<int> G[MAX];
int depth[MAX], par[MAX], leaves[MAX];
vector<int> ord;
void bfs() {
  ord.push_back(0);
  par[0] = -1;
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    int v = ord[i];
    for (__typeof((G[v]).begin()) e = (G[v]).begin(), e_end = (G[v]).end();
         e != e_end; ++e) {
      ord.push_back(*e);
      par[*e] = v;
      depth[*e] = depth[v] + 1;
    }
  }
  for (int i = N; --i;) {
    int v = ord[i];
    if (v != 0 && G[v].size() == 0u) leaves[v] = 1;
    leaves[par[v]] += leaves[v];
  }
}
int mem[MAX];
int max_game() {
  if (N == 1) return 1;
  for (int i = N; i--;) {
    int v = ord[i];
    if (v != 0 && G[v].size() == 0u) {
      mem[v] = 1;
    } else {
      int ma = -1;
      if (depth[v] & 1) {
        ma = 1;
        for (__typeof((G[v]).begin()) e = (G[v]).begin(), e_end = (G[v]).end();
             e != e_end; ++e)
          ma += mem[*e] - 1;
      } else {
        for (__typeof((G[v]).begin()) e = (G[v]).begin(), e_end = (G[v]).end();
             e != e_end; ++e)
          amax(ma, leaves[v] - leaves[*e] + mem[*e]);
      }
      mem[v] = ma;
    }
  }
  return mem[0];
}
int min_game() {
  if (N == 1) return 1;
  memset(mem, 0, sizeof mem);
  for (int i = N; i--;) {
    int v = ord[i];
    if (v != 0 && G[v].size() == 0u) {
      mem[v] = 1;
    } else {
      int mi = N + 10;
      if (depth[v] & 1) {
        for (__typeof((G[v]).begin()) e = (G[v]).begin(), e_end = (G[v]).end();
             e != e_end; ++e)
          amin(mi, mem[*e]);
      } else {
        mi = 0;
        for (__typeof((G[v]).begin()) e = (G[v]).begin(), e_end = (G[v]).end();
             e != e_end; ++e)
          mi += mem[*e];
      }
      mem[v] = mi;
    }
  }
  return mem[0];
}
int main() {
  scanf("%d", &N);
  for (int i = 0, i_len = (N - 1); i < i_len; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    G[a].push_back(b);
  }
  bfs();
  printf("%d %d\n", max_game(), min_game());
  return 0;
}
