#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
vector<int> g[MAXN + 10];
int d[MAXN + 10];
int n, tot;
bool leaf[MAXN + 10];
void dfs(int cur, int prev, int depth) {
  d[cur] = depth;
  int l = 0;
  for (int nxt : g[cur]) {
    if (nxt == prev) continue;
    if (leaf[nxt]) l++;
    dfs(nxt, cur, depth + 1);
  }
  tot -= max(0, l - 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);
  }
  for (int i = 1; i <= n; i++) leaf[i] = (int)g[i].size() == 1;
  tot = n - 1;
  for (int i = 1; i <= n; i++) {
    if ((int)g[i].size() > 1) {
      dfs(i, i, 0);
      break;
    }
  }
  int odd = 0, even = 0;
  for (int i = 1; i <= n; i++) {
    if (leaf[i]) {
      odd += (d[i] & 1);
      even += !(d[i] & 1);
    }
  }
  printf("%d %d\n", (odd && even) ? 3 : 1, tot);
  return 0;
}
