#include <bits/stdc++.h>
using namespace std;
vector<int> g[100001];
int n;
int visited[100001], leaf[100001];
bool odd = 0;
bool od[2];
void dfs(int u, int d) {
  if (leaf[u]) {
    od[d % 2] = 1;
  }
  for (int v : g[u]) {
    if (!visited[v]) {
      visited[v] = 1;
      dfs(v, d + 1);
    }
  }
}
int main() {
  cin >> n;
  for (int i = 1, u, v; i < n; ++i) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  vector<int> L;
  for (int i = 1; i <= n; ++i) {
    if (g[i].size() == 1) leaf[i] = 1;
  }
  int Max = n - 1;
  for (int i = 1, f; i <= n; ++i) {
    f = 0;
    for (int j : g[i]) {
      f += leaf[j];
    }
    if (f >= 2) Max -= f - 1;
  }
  visited[1] = 1;
  dfs(1, 0);
  odd = od[1] && od[0];
  int Min = odd ? 3 : 1;
  cout << Min << " " << Max;
  return 0;
}
