#include <bits/stdc++.h>
using namespace std;
int const M = 2e5 + 10;
vector<int> adj[M];
bool seen[2];
int p[M];
bool mark[M];
void dfs(int v, int l, int path) {
  if (adj[v].size() == 1)
    seen[path] = 1, p[v] = l;
  else
    p[v] = -1;
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (u != l) dfs(u, v, 1 - path);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int root = 1;
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
    if (adj[a].size() > 1) root = a;
    if (adj[b].size() > 1) root = b;
  }
  dfs(root, 0, 0);
  if (seen[1] && seen[0])
    cout << 3 << " ";
  else
    cout << 1 << " ";
  int ans = n - 1;
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() == 1) {
      if (mark[p[i]]) ans--;
      mark[p[i]] = 1;
    }
  }
  cout << ans;
}
