#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")
using namespace std;
const int N = 3e5 + 5, M = 2 * N + 5;
int head[N], nxt[M], to[M], ne, n;
void init() {
  ne = 0;
  memset(head, -1, n * sizeof head[0]);
}
void addEdge(int f, int t) {
  to[ne] = t;
  nxt[ne] = head[f];
  head[f] = ne++;
}
void addBiEdge(int a, int b) {
  addEdge(a, b);
  addEdge(b, a);
}
int root;
int in[N], par[N], dep[N];
void dfs(int u = 0, int p = -1, int d = 0) {
  dep[u] = d;
  par[u] = p;
  for (int e = head[u]; ~e; e = nxt[e]) {
    int v = to[e];
    if (v == p) continue;
    dfs(v, u, d + 1);
  }
}
int cnt[N], check[2];
int main() {
  scanf("%d", &n);
  init();
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    addBiEdge(--u, --v);
    ++in[u], ++in[v];
  }
  dfs();
  int leafs = 0;
  for (int i = 0; i < n; ++i)
    if (in[i] == 1) ++check[dep[i] & 1], ++leafs;
  root = -1;
  for (int i = 0; i < n && root == -1; ++i)
    if (in[i] != 1) root = i;
  dfs(root);
  for (int i = 0; i < n; ++i) {
    if (in[i] != 1 || par[i] == -1) continue;
    ++cnt[par[i]];
  }
  int ans = n - 1;
  for (int i = 0; i < n; ++i) ans -= max(0, cnt[i] - 1);
  printf("%d %d\n", ((check[0] && check[1]) ? 3 : 1), ans);
}
