#include <bits/stdc++.h>
using namespace std;
using llong = long long;
using uint = unsigned int;
const int maxN = 100002;
vector<int> nei[maxN];
int One(int v, int par = -1) {
  if (nei[v].size() == 1) return 0;
  set<int> s;
  for (int to : nei[v])
    if (to != par) {
      int curson = One(to, v);
      if (curson == -1) return -1;
      s.insert(curson);
    }
  if (s.size() > 1) return -1;
  return 1 ^ *s.begin();
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    nei[u].push_back(v);
    nei[v].push_back(u);
  }
  int root = 1;
  for (int v = 1; v <= n; ++v)
    if (nei[v].size() > 1) root = v;
  if (One(root) != -1)
    cout << 1 << ' ';
  else
    cout << 3 << ' ';
  int mx = n - 1;
  for (int v = 1; v <= n; ++v) {
    int leafs = 0;
    for (int to : nei[v])
      if (nei[to].size() == 1) ++leafs;
    mx -= max(0, leafs - 1);
  }
  cout << mx;
}
