#include <bits/stdc++.h>
using namespace std;
bool even = true;
int leaves = 0;
vector<bool> parent(100005, false);
vector<bool> visit(100005, false);
void dfs(vector<vector<int>>& adj, int start, int depth) {
  if (visit[start]) {
  } else {
    visit[start] = true;
    for (int i = 0; i < adj[start].size(); i++) {
      if (adj[adj[start][i]].size() == 1) {
        parent[start] = true;
        leaves++;
        if ((depth + 1) % 2 == 1) {
          even = false;
        }
      }
      dfs(adj, adj[start][i], depth + 1);
    }
  }
}
int main() {
  int n;
  cin >> n;
  vector<vector<int>> adj(n + 1);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  int start;
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() == 1) {
      start = i;
      break;
    }
  }
  dfs(adj, start, 0);
  int low;
  if (even) {
    low = 1;
  } else {
    low = 3;
  }
  int par = 0;
  for (int i = 1; i <= n; i++) {
    if (parent[i]) {
      par++;
    }
  }
  cout << low << " " << n - 1 - leaves + par;
}
