#include <bits/stdc++.h>
using namespace std;
int p[100005];
vector<int> edges[100005];
queue<int> q;
char f[100005];
void bfs(int k) {
  q.push(k);
  f[k] = 1;
  while (!q.empty()) {
    int node = q.front();
    q.pop();
    for (auto &i : edges[node]) {
      if (edges[i].size() != 1 && f[i] == 0) {
        if (f[node] == 1)
          f[i] = 2;
        else if (f[node] == 2)
          f[i] = 1;
        q.push(i);
      }
    }
  }
}
int main() {
  int n, p1 = 0, p2 = 0, maxim, a, b;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    cin >> a >> b;
    edges[a].push_back(b);
    edges[b].push_back(a);
  }
  int noleaf = -1;
  for (int i = 1; i <= n; ++i) {
    if (edges[i].size() == 1) {
      p[edges[i][0]]++;
    } else
      noleaf = i;
  }
  if (noleaf == -1) cout << 1 << " " << 1;
  bfs(noleaf);
  for (int i = 1; i <= n; ++i) {
    if (edges[i].size() != 1) {
      if (p[i] != 0) {
        if (f[i] == 1)
          p1++;
        else if (f[i] == 2)
          p2++;
      }
    }
  }
  if (p1 == 0 || p2 == 0) {
    cout << 1 << " ";
  } else
    cout << 3 << " ";
  maxim = n - 1;
  for (int i = 1; i <= n; ++i) {
    if (edges[i].size() != 1) {
      if (p[i] >= 2) maxim -= (p[i] - 1);
    }
  }
  cout << maxim;
}
