#include <bits/stdc++.h>
using namespace std;
vector<vector<long long> > adj;
void DFS(long long v, long long p, long long dep, vector<long long> &depth) {
  depth[v] = dep;
  for (auto x : adj[v]) {
    if (x == p) continue;
    DFS(x, v, dep + 1, depth);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  adj.resize(n);
  for (long long i = 1; i <= n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    a--, b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  vector<bool> leaf(n, false);
  for (long long i = 0; i < n; i++) {
    if (adj[i].size() == 1) leaf[i] = true;
  }
  vector<long long> depth(n);
  long long root = 0;
  for (; root < n; root++) {
    if (leaf[root]) {
      DFS(root, -1, 0, depth);
      break;
    }
  }
  long long min = 1;
  for (long long i = 0; i < n; i++) {
    if (leaf[i] && depth[i] % 2) min = 3;
  }
  long long max = n - 1;
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    if (leaf[i]) {
      long long x = adj[i].front();
      mp[x]++;
    }
  }
  for (auto x : mp) {
    max -= x.second - 1;
  }
  cout << min << " " << max;
  return 0;
}
