#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
const int SQRTN = 1003;
const int LOGN = 22;
const double PI = acos(-1);
const int INF = 1e9;
const int MOD = 1000000007;
const int FMOD = 998244353;
const double eps = 1e-9;
template <typename T>
T gcd(T a, T b) {
  return (b ? __gcd(a, b) : a);
}
template <typename T>
T lcm(T a, T b) {
  return (a * (b / gcd(a, b)));
}
template <typename T>
T add(T a, T b, T c = MOD) {
  T res = a + b;
  return (res >= c ? res - c : res);
}
template <typename T>
T mod_neg(T a, T b, T c = MOD) {
  T res;
  if (abs(a - b) < c)
    res = a - b;
  else
    res = (a - b) % c;
  return (res < 0 ? res + c : res);
}
template <typename T>
T mul(T a, T b, T c = MOD) {
  long long res = (long long)a * b;
  return (res >= c ? res % c : res);
}
inline long long mulmod(long long a, long long b, long long m = MOD) {
  long long q = (long long)(((long double)a * (long double)b) / (long double)m);
  long long r = a * b - q * m;
  if (r > m) r %= m;
  if (r < 0) r += m;
  return r;
}
template <typename T>
T expo(T e, T n) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = x * p;
    p = p * p;
    n >>= 1;
  }
  return x;
}
template <typename T>
T power(T e, T n, T m = MOD) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = mul(x, p, m);
    p = mul(p, p, m);
    n >>= 1;
  }
  return x;
}
template <typename T>
T extended_euclid(T a, T b, T &x, T &y) {
  T xx = 0, yy = 1;
  y = 0;
  x = 1;
  while (b) {
    T q = a / b, t = b;
    b = a % b;
    a = t;
    t = xx;
    xx = x - q * xx;
    x = t;
    t = yy;
    yy = y - q * yy;
    y = t;
  }
  return a;
}
template <typename T>
T mod_inverse(T a, T n = MOD) {
  T x, y, z = 0;
  T d = extended_euclid(a, n, x, y);
  return (d > 1 ? -1 : mod_neg(x, z, n));
}
void solve() {
  long long k = 0, n = 0, x = 0, m = 0, curr = 0, num = 0, n1 = 0, n2 = 0,
            n3 = 0, n4 = 0, i = 0, j = 0;
  long long root = 0, sum = 0, diff = 0, q = 0, choice = 0, d = 0, len = 0,
            beg = 0, end = 0, pos = 0, cnt = 0;
  long long lo = 0, hi = 0, mid = 0, ans = 0;
  bool flag = false;
  string s1, s2, s3, str;
  char ch, ch1, ch2, ch3, *ptr;
  double dub = 0;
  cin >> n;
  vector<vector<long long> > gr(n);
  for (int(i) = 0; (i) < (n - 1); (i)++) {
    cin >> n1 >> n2;
    n1--, n2--;
    gr[n1].push_back(n2);
    gr[n2].push_back(n1);
  }
  hi = n - 1;
  n1 = n2 = 0;
  set<long long> ft;
  for (int(i) = 0; (i) < (n); (i)++) {
    if (((int)((gr[i]).size())) == 1) {
      n1++;
      n2 = i;
      ft.insert(gr[i][0]);
    }
  }
  hi -= (n1 - ((int)((ft).size())));
  if (n == 2)
    lo = 1;
  else {
    vector<long long> lev(n), vis(n, 0), diss;
    queue<long long> curr;
    curr.push(n2);
    flag = false;
    lev[n2] = 0;
    while (!curr.empty()) {
      n1 = curr.front();
      curr.pop();
      cnt = 0;
      for (i = 0; i < ((int)((gr[n1]).size())); i++) {
        n2 = gr[n1][i];
        if (vis[n2] == 0) {
          vis[n2] = 1;
          curr.push(n2);
          lev[n2] = lev[n1] + 1;
        }
      }
      if (((int)((gr[n1]).size())) == 1 && flag) {
        diss.push_back(lev[n1]);
      } else
        flag = true;
    }
    n1 = 0;
    n2 = 0;
    for (int(i) = 0; (i) < (((int)((diss).size()))); (i)++) {
      if (diss[i] % 2)
        n1++;
      else
        n2++;
    }
    if (n1 > 0)
      lo = 3;
    else
      lo = 1;
  }
  cout << lo << " " << hi << "\n";
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
