#include <bits/stdc++.h>
using namespace std;
vector<int> g[100100];
int n;
int res[100100];
int path_odd[100100];
int path_even[100100];
int degree[100100];
vector<int> v[100100];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    scanf("%d", &x);
    scanf("%d", &y);
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
    degree[x]++;
    degree[y]++;
  }
  queue<int> q;
  for (int i = 0; i < n; i++) {
    if (g[i].size() == 1) {
      q.push(i);
      v[i].push_back(0);
      path_even[i] = 1;
    }
  }
  int mn = 1, mx = 0;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    degree[x]--;
    res[x] = 0;
    sort(v[x].begin(), v[x].end());
    res[x] += v[x][0];
    for (int i = 1; i < v[x].size(); i++)
      if (v[x][i] != 1) res[x] += v[x][i];
    mx = max(res[x], mx);
    for (int i = 0; i < g[x].size(); i++) {
      int c = g[x][i];
      if (degree[c] == 0) {
        if (path_even[c]) path_odd[x] = 1;
        if (path_odd[c]) path_even[x] = 1;
      } else {
        degree[c]--;
        v[c].push_back(res[x] + 1);
        if (degree[c] == 1) q.push(c);
      }
    }
    if (path_odd[x] && path_even[x]) mn = 3;
  }
  cout << mn << " " << mx << endl;
  return 0;
}
