#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
const int MOD = 998244353;
const int nmax = 201234;
int n, res1, res2, cnt[2];
vector<int> v2[nmax];
int dfs(int s, int f, int h) {
  int flg = 0, ans = 0;
  for (int i = 0; i < v2[s].size(); ++i) {
    int v = v2[s][i];
    if (v != f) {
      flg = 1;
      ans += dfs(v, s, h + 1);
    }
  }
  if (ans > 1) res2 -= ans - 1;
  if (flg == 0) {
    cnt[h % 2]++;
    return 1;
  }
  return 0;
}
int main() {
  scanf("%d", &n);
  for (int u, v, i = 1; i < n; ++i) {
    scanf("%d%d", &u, &v);
    v2[u].push_back(v);
    v2[v].push_back(u);
  }
  int root = 1;
  for (; root <= n; ++root)
    if (v2[root].size() != 1) break;
  res2 = n - 1;
  dfs(root, 0, 0);
  if (cnt[0] && cnt[1])
    res1 = 3;
  else
    res1 = 1;
  printf("%d %d\n", res1, res2);
  return 0;
}
