#include <bits/stdc++.h>
using namespace std;
vector<int> tree[100005];
bool visited[100005];
int degree[100005];
int N;
bool even = true;
int dfs(int root) {
  if (visited[root]) {
    return 0;
  }
  if (degree[root] == 1) {
    return 1;
  }
  visited[root] = true;
  int sum = 0;
  for (int i : tree[root]) {
    sum |= dfs(i);
  }
  if (sum == 3) return 3;
  return sum == 1 ? 2 : 1;
}
int bfs(int root) {
  queue<int> to_s;
  to_s.push(root);
  int sum = 0;
  while (to_s.size()) {
    int t = to_s.front();
    to_s.pop();
    visited[t] = true;
    int nleave = 0;
    for (int i : tree[t]) {
      if (degree[i] == 1) {
        ++nleave;
        continue;
      }
      if (!visited[i]) {
        ++sum;
        to_s.push(i);
      }
    }
    if (nleave) ++sum;
  }
  return sum;
}
void solve() {
  int root;
  for (root = 1; root < N; ++root) {
    if (degree[root] > 1) break;
  }
  int oddity = dfs(root);
  if (oddity == 3) {
    printf("3 ");
  } else
    printf("1 ");
  memset(visited, 0, sizeof(visited));
  printf("%d", bfs(root));
}
int main() {
  memset(visited, 0, sizeof(visited));
  scanf("%d", &N);
  for (int i = 1; i < N; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    ++degree[u];
    ++degree[v];
    tree[u].push_back(v);
    tree[v].push_back(u);
  }
  solve();
}
