#include <bits/stdc++.h>
using namespace std;
vector<long long> adj[100005];
long long vis[100005], mn, mx, odd[100005], even[100005], leaf[100005];
void dfs(long long src) {
  vis[src] = 1;
  leaf[src] = 1;
  long long cnt = 0;
  for (long long i = 0; i < adj[src].size(); i++) {
    long long node = adj[src][i];
    if (vis[node] == 0) {
      dfs(node);
      leaf[src] = 0;
      cnt += leaf[node];
      odd[src] |= even[node];
      even[src] |= odd[node];
    }
  }
  mx -= max((long long)0, (cnt - 1));
  if (odd[src] && even[src]) mn = 3;
  if (leaf[src]) even[src] = 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  long long root = 1;
  for (long long i = 1; i <= n; i++) {
    long long sz = adj[i].size();
    if (sz != 1) {
      root = i;
      break;
    }
  }
  mx = n - 1;
  mn = 1;
  dfs(root);
  cout << mn << " " << mx << "\n";
  return 0;
}
