#include <bits/stdc++.h>
using namespace std;
mt19937_64 mt(time(0));
const int MAXN = 1e5 + 10;
int deep[MAXN];
vector<int> edges[MAXN];
int ret = 0;
set<int> table;
void solve(int cur, int par) {
  deep[cur] = deep[par] + 1;
  if (edges[cur].size() == 1) table.insert(deep[cur] % 2);
  bool has_zero = false;
  for (int nxt : edges[cur]) {
    if (nxt == par) continue;
    solve(nxt, cur);
    if (edges[nxt].size() != 1)
      ret++;
    else
      has_zero = true;
  }
  if (has_zero) ret++;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(10);
  cout << fixed;
  int n, a, b;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    edges[a].push_back(b);
    edges[b].push_back(a);
  }
  int root = 1;
  while (edges[root].size() == 1) root++;
  solve(root, 0);
  if (table.size() != 2)
    cout << "1 ";
  else
    cout << "3 ";
  cout << ret << '\n';
  return 0;
}
