#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
vector<int> adj[N];
int nl = 0;
int dist[N];
set<int> s;
int leaves = 0;
int l = 0;
void dfs(int u, int par) {
  bool ok = false;
  for (int& v : adj[u]) {
    if (v != par) {
      dist[v] = dist[u] + 1;
      if ((int)adj[v].size() == 1) s.insert(dist[v] & 1);
      dfs(v, u);
    }
    if ((int)adj[u].size() != 1 && (int)adj[v].size() == 1) {
      ok = true;
    }
  }
  nl += ok;
}
void solve() {
  int n;
  cin >> n;
  int e = n - 1;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  s.insert(0);
  for (int i = 0; i < n; i++) {
    if ((int)adj[i].size() == 1) {
      ++leaves;
      l = i;
    }
  }
  dfs(l, -1);
  if ((int)s.size() == 2)
    cout << "3 ";
  else
    cout << "1 ";
  cout << e - leaves + nl;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  while (t--) {
    solve();
  }
}
