#include <bits/stdc++.h>
using namespace std;
namespace RA {
int r(int p) { return 1ll * rand() * rand() % p; }
int r(int L, int R) { return r(R - L + 1) + L; }
}  // namespace RA
const int N = 1e5 + 5;
int n, dg[N], sz[N], dep[N], flag[2], f[N];
vector<int> g[N];
void dfs(int u, int p) {
  dep[u] = dep[p] + 1, sz[u] = 1;
  if (dg[u] == 1) flag[dep[u] & 1] = 1;
  for (int v : g[u])
    if (v != p) dfs(v, u), sz[u] += sz[v];
  int s0 = 0;
  for (int v : g[u])
    if (v != p) {
      if (sz[v] == 1)
        s0 = 1;
      else
        f[u] += f[v] + 1;
    }
  f[u] += s0;
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n - 1); ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a].push_back(b), g[b].push_back(a);
    dg[a]++, dg[b]++;
  }
  int root = max_element(dg + 1, dg + n + 1) - dg;
  dfs(root, 0);
  if (flag[0] & flag[1])
    printf("3 ");
  else
    printf("1 ");
  printf("%d\n", f[root]);
  return 0;
}
