#include <bits/stdc++.h>
using namespace std;
int deg[100011];
int l[2];
vector<int> adj[100011];
int p[100011];
void dfs(int x, int parent, int parity) {
  p[x] = parent;
  if (adj[x].size() == 1) l[parity]++;
  if (parity)
    parity = 0;
  else
    parity = 1;
  for (auto c : adj[x]) {
    if (c != parent) dfs(c, x, parity);
  }
}
int main() {
  int n;
  cin >> n;
  int u, v;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
    deg[u]++;
    deg[v]++;
  }
  int x = 1;
  while (adj[x].size() == 1) x++;
  dfs(x, -1, 1);
  if (l[0] && l[1]) {
    cout << "3 ";
  } else
    cout << "1 ";
  int ans = n - 1;
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() == 1) continue;
    int w = 0;
    for (int c : adj[i]) {
      if (c == p[i]) continue;
      if (adj[c].size() == 1) w++;
    }
    ans -= w ? w - 1 : 0;
  }
  cout << ans << endl;
  return 0;
}
