#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int n;
int tot = -1, head[N];
struct Edge {
  int p, nxt;
  Edge(int p = 0, int nxt = 0) : p(p), nxt(nxt) {}
} edge[N * 2];
inline void Add(int u, int v) {
  edge[++tot] = Edge(v, head[u]);
  head[u] = tot;
  return;
}
int f[N], g[N], cnt[N];
void DFS(int u, int fa, int dep) {
  for (int i = head[u]; ~i; i = edge[i].nxt) {
    int v = edge[i].p;
    if (v == fa) continue;
    DFS(v, u, dep ^ 1);
    cnt[u] += cnt[v];
  }
  if (!cnt[u]) {
    f[u] = g[u] = cnt[u] = 1;
    return;
  }
  if (dep) {
    for (int i = head[u]; ~i; i = edge[i].nxt) {
      int v = edge[i].p;
      if (v == fa) continue;
      f[u] = max(f[u], cnt[u] - (cnt[v] - f[v]));
      g[u] += g[v];
    }
  } else {
    f[u] = 1;
    g[u] = cnt[u];
    for (int i = head[u]; ~i; i = edge[i].nxt) {
      int v = edge[i].p;
      if (v == fa) continue;
      f[u] += f[v] - 1;
      g[u] = min(g[u], g[v]);
    }
  }
  return;
}
int main() {
  scanf("%d", &n);
  memset(head, -1, sizeof(head));
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    Add(u, v);
    Add(v, u);
  }
  DFS(1, 0, 1);
  printf("%d %d\n", f[1], g[1]);
  return 0;
}
