#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> G[100005];
int num[100005];
int dep[100005];
int mi, mx;
int odd, even;
void dfs(int u, int fa, int dep) {
  if (G[u].size() == 1) {
    if (dep % 2) odd = 1;
    if (dep % 2 == 0) even = 1;
    num[G[u][0]]++;
  }
  for (auto T : G[u]) {
    if (T == fa) continue;
    dfs(T, u, dep + 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1, 0, 0);
  if (odd && even)
    mi = 3;
  else
    mi = 1;
  mx = n - 1;
  for (int i = 1; i <= n; i++) {
    if (num[i] >= 2) {
      mx -= num[i];
      mx = mx + 1;
    }
  }
  printf("%d %d\n", mi, mx);
}
