#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 10;
int res, cnt, head[M], in[M], dep[2];
struct node {
  int next, to;
} edge[M * 2];
void add_edge(int u, int v) {
  edge[++cnt].next = head[u];
  edge[cnt].to = v;
  head[u] = cnt;
}
void dfs(int u, int fa, int h) {
  if (in[u] == 1) dep[h % 2] = 1;
  int ans = 0;
  for (int i = head[u]; i; i = edge[i].next) {
    int v = edge[i].to;
    if (v == fa) continue;
    dfs(v, u, h + 1);
    if (in[v] == 1) ans++;
  }
  if (ans > 1) res += ans - 1;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1, u, v; i < n; i++) {
    scanf("%d%d", &u, &v);
    add_edge(u, v);
    add_edge(v, u);
    in[u]++;
    in[v]++;
  }
  int root;
  for (int i = 1; i <= n; i++) {
    if (in[i] != 1) root = i;
  }
  dfs(root, 0, 1);
  if (dep[0] && dep[1])
    printf("3 ");
  else
    printf("1 ");
  printf("%d\n", (n - 1) - res);
  return 0;
}
