#include <bits/stdc++.h>
using namespace std;
const int nax = 1e5 + 200;
vector<int> g[nax];
bool leave[nax];
bool dfs(int u, int p, int depth) {
  bool ans = false;
  for (int v : g[u]) {
    if (p == v) continue;
    ans |= dfs(v, u, depth + 1);
  }
  if (leave[u]) {
    ans |= (depth & 1);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << setprecision(20) << fixed;
  int n;
  cin >> n;
  int u, v;
  for (int i = 0; i < (int)n - 1; ++i) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int maximum = n - 1;
  for (int i = 1; i <= (int)n; ++i) {
    leave[i] = (g[i].size() == 1);
    maximum -= leave[i];
  }
  for (int i = 1; i <= (int)n; ++i) {
    if (leave[i]) continue;
    for (int v : g[i]) {
      if (leave[v]) {
        maximum++;
        break;
      }
    }
  }
  int minimum;
  for (int i = 1; i <= (int)n; ++i) {
    if (leave[i]) {
      minimum = dfs(i, 0, 0);
      break;
    }
  }
  cout << (minimum ? 3 : 1) << " " << maximum << '\n';
}
