#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
vector<int> g[maxn];
int d[maxn];
void bfs(int q) {
  memset(d, -1, sizeof(d));
  queue<int> qu;
  qu.push(q);
  d[q] = 0;
  while (!qu.empty()) {
    int now = qu.front();
    qu.pop();
    for (auto i : g[now]) {
      if (d[i] == -1) {
        d[i] = d[now] + 1;
        qu.push(i);
      }
    }
  }
}
int main() {
  int T, n;
  cin >> n;
  for (int u, v, i = 1; i < n; i++) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int minx = 1, maxx = n - 1;
  int rt = 1;
  while (g[rt].size() != 1) rt++;
  bfs(rt);
  for (int i = 1; i <= n; i++) {
    if (g[i].size() == 1 && d[i] % 2 == 1) minx = 3;
  }
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    for (auto j : g[i]) {
      if (g[j].size() == 1) cnt++;
    }
    if (cnt >= 2) maxx -= cnt - 1;
  }
  printf("%d %d\n", minx, maxx);
  return 0;
}
