#include <bits/stdc++.h>
const int N = 1e5 + 10;
using namespace std;
vector<int> g[N];
int dp = -1, flag1 = 0;
map<int, int> mp;
int ind[N];
void dfs(int u, int dep, int fa) {
  for (int i = 0; i < g[u].size(); i++) {
    int j = g[u][i];
    if (j == fa) continue;
    dfs(j, dep + 1, u);
  }
  if (g[u].size() == 1) {
    mp[fa]++;
    if (dp == -1) {
      if (dep & 1)
        dp = 1;
      else
        dp = 0;
    }
    if (dp != -1) {
      if (dep % 2 == 1 && dp == 0)
        flag1 = 1;
      else if (dep % 2 == 0 && dp == 1)
        flag1 = 1;
    }
  }
}
signed main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a].push_back(b);
    g[b].push_back(a);
    ind[a]++, ind[b]++;
  }
  int rt;
  for (int i = 1; i <= n; i++)
    if (ind[i] != 1) {
      rt = i;
      break;
    }
  dfs(rt, 0, -1);
  int res = n - 1;
  for (int i = 1; i <= n; i++)
    if (mp[i]) res -= (mp[i] - 1);
  printf("%d %d\n", flag1 == 1 ? 3 : 1, res);
}
