#include <bits/stdc++.h>
using namespace std;
int n, tot;
int eg[100005][2];
int deg[100005], mark[100005], ans[100005];
struct edge {
  int v;
  edge *next;
} pool[200005], *h[100005];
void addedge(int u, int v) {
  edge *p = &pool[tot++];
  p->v = v;
  p->next = h[u];
  h[u] = p;
}
void dfs(int u, int fa) {
  ans[u] = 1 - ans[fa];
  for (edge *p = h[u]; p; p = p->next) {
    if (p->v != fa) dfs(p->v, u);
  }
}
bool chk() {
  int tmp = -1;
  for (int i = 1; i <= n; i++) {
    if (deg[i] == 1) {
      if (tmp == -1)
        tmp = ans[i];
      else if (ans[i] != tmp)
        return 0;
    }
  }
  return 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &eg[i][0], &eg[i][1]);
    deg[eg[i][0]]++, deg[eg[i][1]]++;
    addedge(eg[i][0], eg[i][1]);
    addedge(eg[i][1], eg[i][0]);
  }
  dfs(1, 0);
  for (int i = 1; i < n; i++) {
    if (deg[eg[i][0]] == 1) mark[eg[i][1]] = 1;
    if (deg[eg[i][1]] == 1) mark[eg[i][0]] = 1;
  }
  int cnt = n - 1;
  for (int i = 1; i <= n; i++) {
    if (deg[i] == 1) cnt--;
    if (mark[i] == 1) cnt++;
  }
  if (chk())
    printf("1 %d", cnt);
  else
    printf("3 %d", cnt);
  return 0;
}
