#include <bits/stdc++.h>
const double eps = 1e-10;
const int INF = 0x3f3f3f3f;
const long long inf = 0x3f3f3f3f3f3f3f3f;
using namespace std;
const int N = 1e5 + 7;
int t, n, m, ans = 0, fl = 0;
vector<int> v[100005], one;
int qi = 0;
void dfs(int x, int y, int z) {
  int aa = 0;
  if (ans) return;
  if (y != -1 && v[x].size() == 1) {
    if (z % 2) ans = 1;
    return;
  }
  for (long long i = 0; i <= v[x].size() - 1; i++) {
    if (v[x][i] == y) continue;
    dfs(v[x][i], x, z + 1);
  }
  return;
}
int main() {
  scanf("%d", &n);
  int minn = 0, maxn = n - 1;
  for (long long i = 1; i <= n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (long long i = 1; i <= n; i++) {
    if (v[i].size() == 1 && qi == 0) {
      qi = i;
    }
    int cnt = 0;
    for (long long j = 0; j <= v[i].size() - 1; j++) {
      if (v[v[i][j]].size() == 1) cnt++;
    }
    if (cnt >= 2) fl += cnt - 1;
  }
  dfs(qi, -1, 0);
  if (ans == 0)
    minn = 1;
  else
    minn = 3;
  maxn -= fl;
  printf("%d %d\n", minn, maxn);
  return 0;
}
