#include <bits/stdc++.h>
using namespace std;
inline long long getnum() {
  char c = getchar();
  long long num, sign = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') sign = -1;
  for (num = 0; c >= '0' && c <= '9';) {
    c -= '0';
    num = num * 10 + c;
    c = getchar();
  }
  return num * sign;
}
vector<int> V[100004];
int X[100004][2];
void dfs(int v, int p) {
  if (V[v].size() == 1) {
    X[v][0] = 1;
  }
  for (int i : V[v]) {
    if (i == p) continue;
    dfs(i, v);
    if (X[i][0]) X[v][1] = 1;
    if (X[i][1]) X[v][0] = 1;
  }
}
int main() {
  int n = getnum();
  if (n == 2) {
    printf("1 1");
    return 0;
  }
  for (int i = 1; i < n; i++) {
    int x = getnum(), y = getnum();
    V[x].push_back(y);
    V[y].push_back(x);
  }
  int st = 0, cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (V[i].size() > 1) {
      st = i;
      cnt++;
      for (int x : V[i]) {
        if (V[x].size() == 1) {
          cnt++;
          break;
        }
      }
    }
  }
  cnt--;
  dfs(st, 0);
  if (X[st][0] && X[st][1]) {
    printf("3 %d", cnt);
  } else {
    printf("1 %d", cnt);
  }
}
