#include <bits/stdc++.h>
using namespace std;
long long _();
int main() {
  _();
  return 0;
}
const long long N = 1e5;
vector<long long> t[N];
bool o[N];
long long X;
bool mini(long long x, bool v) {
  if (o[x]) return 0;
  o[x] = 1;
  if (t[x].size() == 1 && x != X) return v;
  for (long long y : t[x])
    if (mini(y, !v)) return 1;
  return 0;
}
long long _() {
  ios_base::sync_with_stdio(false);
  long long n;
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    a--;
    b--;
    t[a].push_back(b);
    t[b].push_back(a);
  }
  for (;; X++)
    if (t[X].size() == 1) break;
  long long a = mini(X, 0) ? 3 : 1;
  long long b = n - 1;
  for (long long i = 0; i < n; i++) {
    long long c = 0;
    for (long long j : t[i])
      if (t[j].size() == 1) {
        c++;
      }
    b -= max(0LL, c - 1);
  }
  cout << a << " " << b << endl;
  return 0;
}
