#include <bits/stdc++.h>
using namespace std;
int n, root;
vector<int> adj[100005];
int lpar = -1;
bool dfs1(int node, bool parity, int p) {
  if (adj[node].size() == 1u) {
    if (lpar == -1) {
      lpar = parity;
    } else if (lpar != parity) {
      return false;
    }
  }
  for (int child : adj[node]) {
    if (child != p) {
      if (!dfs1(child, !parity, node)) {
        return false;
      }
    }
  }
  return true;
}
int total;
void dfs2(int node, int p) {
  int c = 0;
  for (int child : adj[node]) {
    if (child != p) {
      if (adj[child].size() == 1u) {
        c++;
      }
    }
  }
  total -= max(c - 1, 0);
  for (int child : adj[node]) {
    if (child != p) {
      dfs2(child, node);
    }
  }
}
int main() {
  cin >> n;
  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);
  }
  for (int i = 0; i < n; i++) {
    if (adj[i].size() > 1u) {
      root = i;
      break;
    }
  }
  cout << (dfs1(root, false, -1) ? 1 : 3) << ' ';
  total = n - 1;
  dfs2(root, -1);
  cout << total << '\n';
}
