#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > a(300000);
vector<bool> islist(300000, false);
vector<int> counoflist(300000, 0);
vector<int> len(300000, 0);
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int v1, v2;
    cin >> v1 >> v2;
    v1--;
    v2--;
    a[v1].push_back(v2);
    a[v2].push_back(v1);
  }
  for (int i = 0; i < n; i++) {
    if ((int)a[i].size() == 1) {
      islist[i] = true;
      counoflist[a[i][0]]++;
    }
  }
  int ma = n - 1;
  for (int i = 0; i < n; i++) {
    ma -= max(counoflist[i] - 1, 0);
  }
  int in = -1;
  for (int i = 0; i < n; i++) {
    if (islist[i]) in = i;
  }
  assert(in != -1);
  queue<int> q;
  q.push(in);
  while (!q.empty()) {
    int cur = q.front();
    q.pop();
    for (auto &x : a[cur]) {
      if (len[x] == 0) {
        len[x] = len[cur] + 1;
        q.push(x);
      }
    }
  }
  int mi = 1;
  for (int i = 0; i < n; i++) {
    if (i == in) continue;
    if (len[i] % 2 == 1 && islist[i]) mi = 3;
  }
  cout << mi << " " << ma << "\n";
}
