#include <bits/stdc++.h>
using namespace std;
vector<int> g[100005];
bool vis[100005];
int nextt = 0, leaves = 0;
bool one = true;
bool dfs(int v, int level) {
  int br = 0;
  int i, j;
  vis[v] = 1;
  bool fl = false;
  for (i = 0; i < g[v].size(); i++) {
    if (vis[g[v][i]]) continue;
    br++;
    if (dfs(g[v][i], level + 1)) fl = true;
  }
  if (fl && level != 1) nextt++;
  if (br == 0) {
    leaves++;
    if (level % 2 != 0) one = 0;
    return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, i, j, a, b;
  cin >> n;
  for (i = 1; i < n; i++) {
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (i = 1; i <= n; i++) {
    if (g[i].size() == 1) {
      dfs(i, 0);
      break;
    }
  }
  nextt++;
  leaves++;
  if (one)
    cout << "1 ";
  else
    cout << "3 ";
  cout << (n - leaves + nextt - 1) << endl;
  return 0;
}
