#include <bits/stdc++.h>
using namespace std;
void print_int(vector<int>);
void print_ll(vector<long long>);
long long power(long long, long long);
vector<int> *v;
int n, m;
int parity;
int leaf_adj;
int leaf;
int edges;
int root;
void igraph(int n, int m) {
  v = new vector<int>[n + 1];
  for (int i = 0; i < int(m); i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
}
int dfs(int s, int p, int l = 0) {
  if (v[s].size() == 1 and v[s][0] == p) {
    parity = parity or (l & 1);
    leaf++;
    return 0;
  }
  int ret = 0;
  int flag = 0;
  if (p == root) flag = 1;
  for (int d : v[s]) {
    if (d == p) continue;
    int ret1 = dfs(d, s, l + 1);
    ret += (1 + ret1);
    if (ret1 == 0) flag = 1;
  }
  if (flag) leaf_adj++;
  return ret;
}
void solve() {
  cin >> n;
  m = n - 1;
  igraph(n, m);
  for (int i = 0; i < int(n); i++) {
    if (i == 0) continue;
    if (v[i].size() == 1) {
      root = i;
      edges = dfs(i, 0);
      break;
    }
  }
  if (parity)
    cout << 3 << " ";
  else
    cout << 1 << " ";
  cout << edges - (leaf + 1) + leaf_adj << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  for (int t = 1; t <= T; t++) {
    solve();
  }
  return 0;
}
void print_int(vector<int> v) {
  for (int i : v) cout << i << " ";
  cout << endl;
}
void print_ll(vector<long long> v) {
  for (long long i : v) cout << i << " ";
  cout << endl;
}
long long power(long long n, long long p) {
  long long res = 1;
  while (p != 0) {
    if (p & 1) res = res * n;
    n = n * n;
    p = p >> 1;
  }
  return res;
}
