#include <bits/stdc++.h>
const int MAXN = 200000 + 1;
int n, m;
struct Edge {
  int s, t, next;
  Edge(int s = 0, int t = 0, int next = 0) : s(s), t(t), next(next) {}
} edge[MAXN * 2];
int head[MAXN], _new;
inline void addEdge(const int &s, const int &t) {
  edge[++_new] = Edge(s, t, head[s]);
  head[s] = _new;
}
int f[MAXN], g[MAXN];
void dfs(int u, int p, int round) {
  if (round == 0) {
    f[u] = INT_MAX;
    g[u] = 0;
  }
  if (round == 1) {
    g[u] = INT_MAX;
    f[u] = 0;
  }
  int size = 0;
  for (int e = head[u]; e; e = edge[e].next) {
    int v = edge[e].t;
    if (v == p) continue;
    size++;
    dfs(v, u, round ^ 1);
    if (round == 0) {
      f[u] = std::min(f[u], f[v]);
      g[u] += g[v];
    }
    if (round == 1) {
      g[u] = std::min(g[u], g[v]);
      f[u] += f[v];
    }
  }
  if (!size) {
    m++;
    f[u] = 1;
    g[u] = 1;
  }
}
int main(int argc, char *argv[]) {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    addEdge(u, v);
    addEdge(v, u);
  }
  dfs(1, 0, 0);
  printf("%d %d\n", m - f[1] + 1, g[1]);
  return 0;
}
