#include <bits/stdc++.h>
using namespace std;
const int MaxN = 200000 + 10;
int n, head[MaxN], to[MaxN], nxt[MaxN], top;
void addedge(int fr, int tt) {
  top++;
  nxt[top] = head[fr];
  to[top] = tt;
  head[fr] = top;
}
void init() {
  scanf("%d", &n);
  int a, b;
  for (int i = 1; i < n; ++i) {
    scanf("%d%d", &a, &b);
    addedge(a, b);
  }
}
int que[MaxN], size[MaxN], bt[MaxN], wrs[MaxN], deep[MaxN];
void solve() {
  int lead = 1, tail = 0, now;
  deep[que[++tail] = 1] = 1;
  for (; lead <= tail; ++lead) {
    now = que[lead];
    for (int i = head[now]; i; i = nxt[i]) {
      que[++tail] = to[i];
      deep[to[i]] = deep[now] + 1;
    }
  }
  for (int j = tail; j >= 1; --j) {
    now = que[j];
    size[now] = 0;
    for (int i = head[now]; i; i = nxt[i]) size[now] += size[to[i]];
    if (!head[now]) {
      bt[now] = wrs[now] = size[now] = 1;
    } else {
      if (deep[now] & 1) {
        for (int i = head[now]; i; i = nxt[i]) wrs[now] += wrs[to[i]];
        for (int i = head[now]; i; i = nxt[i])
          bt[now] = max(bt[now], bt[to[i]] + size[now] - size[to[i]]);
      } else {
        wrs[now] = 0x3f3f3f3f;
        for (int i = head[now]; i; i = nxt[i])
          wrs[now] = min(wrs[now], wrs[to[i]]);
        for (int i = head[now]; i; i = nxt[i]) bt[now] += bt[to[i]] - 1;
        ++bt[now];
      }
    }
  }
  printf("%d %d\n", bt[1], wrs[1]);
}
int main() {
  init();
  solve();
  return 0;
}
