#include <bits/stdc++.h>
using namespace std;
vector<int> adj[200000];
set<int> s;
bool fmin1 = true;
int cnt;
void dfs(int v, int p = -1, int d = 0) {
  if (p != -1 && adj[v].size() == 1) {
    s.insert(p);
    cnt--;
    if (d % 2) fmin1 = false;
    return;
  }
  for (int to : adj[v]) {
    if (to == p) continue;
    dfs(to, v, d + 1);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  cnt = n - 2;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  int i;
  for (i = 0; i < n; i++) {
    if (adj[i].size() == 1) break;
  }
  s.insert(adj[i][0]);
  dfs(i);
  cout << (fmin1 ? 1 : 3) << ' ' << cnt + s.size();
}
