#include <bits/stdc++.h>
using namespace std;
;
const int max_n = 1e5 + 100;
int n;
bool vis[max_n];
vector<int> T[max_n];
struct node {
  int from = 0;
  vector<int> next;
} G[max_n];
int cmp;
bool judge(int root) {
  if (G[root].next.size() == 0) {
    cmp = 1;
    return true;
  }
  int now_cmp = -1;
  for (int child = 0; child < G[root].next.size(); child++) {
    if (!judge(G[root].next[child])) return false;
    if (now_cmp == -1) {
      now_cmp = cmp;
      if (now_cmp == 1 && G[root].from == 0 && G[root].next.size() == 1)
        return false;
    } else if (cmp != now_cmp)
      return false;
  }
  cmp = now_cmp ^ 1;
  return true;
}
void bfs(int start) {
  deque<int> que;
  que.push_back(start);
  while (!que.empty()) {
    int cur = que.front();
    que.pop_front();
    vis[cur] = true;
    for (int i = 0; i < T[cur].size(); i++) {
      if (vis[T[cur][i]]) continue;
      G[cur].next.push_back(T[cur][i]);
      G[T[cur][i]].from = cur;
      que.push_back(T[cur][i]);
    }
  }
  fill(vis, vis + n + 1, false);
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    T[a].push_back(b);
    T[b].push_back(a);
  }
  bfs(1);
  if (judge(1))
    cout << 1 << " ";
  else
    cout << 3 << " ";
  int leaves = 0;
  int above = 0;
  for (int i = 2; i <= n; i++) {
    if (G[i].next.size() == 0) {
      leaves++;
      if (vis[G[i].from]) continue;
      vis[G[i].from] = true;
      above++;
    }
  }
  if (G[1].next.size() == 1) {
    leaves++;
    if (!vis[G[1].next[0]]) above++;
  }
  cout << n - leaves + above - 1 << endl;
}
