#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e5 + 9;
vector<long long> g[maxn];
long long dp[2];
long long n, ans;
void dfs(long long v, long long pr, long long h) {
  bool fl = 0;
  for (long long to : g[v]) {
    if (to == pr) continue;
    if ((long long)g[to].size() == 1) {
      if (!fl) {
        ans++;
        fl = 1;
      }
    } else
      ans++;
    dfs(to, v, h ^ 1);
  }
  if ((long long)g[v].size() == 1) dp[h]++;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    a--, b--;
    g[a].emplace_back(b);
    g[b].emplace_back(a);
  }
  long long st = 0;
  for (long long i = 0; i < n; i++) {
    if (g[i].size() >= 2) {
      st = i;
      break;
    }
  }
  dfs(st, -1, 0);
  if (dp[0] && dp[1])
    cout << "3 ";
  else
    cout << "1 ";
  cout << ans;
}
