#include <bits/stdc++.h>
using namespace std;
long long int n;
vector<vector<long long int> > adj;
long long int odd(0);
vector<long long int> dist;
long long int p_leaf(0), leaf(0), root(0);
unordered_map<long long int, long long int> deg;
void dfs(long long int node, long long int p) {
  long long int l = 0;
  for (int x : adj[node]) {
    if (x == root) ++l;
    if (x == p) continue;
    dist[x] = dist[node] + 1;
    dfs(x, node);
    if (deg[x] != 1) continue;
    ++l;
    if (dist[x] % 2 == 1) odd++;
  }
  leaf += l;
  if (l > 0) p_leaf++;
}
void mainSolve() {
  cin >> n;
  adj.resize(n + 1);
  dist.resize(n + 1, 0);
  for (int i = 1; i < n; i++) {
    long long int a;
    cin >> a;
    long long int b;
    cin >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
    deg[a]++;
    deg[b]++;
  }
  long long int f_min, f_max;
  for (int i = 1; i <= n; i++) {
    if (deg[i] == 1) {
      root = i;
      dfs(i, 0);
      f_min = (odd == 0 ? 1 : 3);
      f_max = (n - 1) - leaf + p_leaf;
      break;
    }
  }
  cout << f_min << " " << f_max << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  while (t--) {
    mainSolve();
  }
  return 0;
}
