#include <bits/stdc++.h>
using namespace std;
bool odd = false;
int path = 0, cnt1 = 0, cnt2 = 0;
void dfs(vector<int> v[], int i, int h, int p) {
  bool flag = true, f = false;
  for (auto it = v[i].begin(); it != v[i].end(); it++) {
    if (*it != p) {
      dfs(v, *it, h + 1, i);
      flag = false;
    }
    if (v[*it].size() == 1) f = true;
  }
  if (f) cnt2++;
  if (flag && h % 2) odd = true;
  if (flag) path = max(path, h), cnt1++;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t, n, i, x, y;
  cin >> n;
  vector<int> v[n + 1];
  for (i = 0; i < n - 1; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int node = 1;
  for (i = 1; i < n + 1; i++)
    if (v[i].size() == 1) node = i;
  dfs(v, node, 0, 0);
  cnt1++;
  if (odd)
    cout << 3 << " ";
  else
    cout << 1 << " ";
  cout << n - 1 - cnt1 + cnt2 << endl;
}
