#include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int> > gr;
vector<int> used, kols;
void dfs(int v, int c) {
  used[v] = c;
  for (int nv : gr[v])
    if (!used[nv]) dfs(nv, 3 - c);
}
void solve() {
  cin >> n;
  gr.assign(n, vector<int>());
  for (int i = 1; i < n; ++i) {
    int v1, v2;
    cin >> v1 >> v2;
    --v1;
    --v2;
    gr[v1].push_back(v2);
    gr[v2].push_back(v1);
  }
  used.assign(n, 0);
  kols.assign(n, 0);
  dfs(0, 1);
  int ans2 = n - 1;
  int c1 = 0;
  int c2 = 0;
  for (int i = 0; i < n; ++i)
    if (gr[i].size() == 1) {
      if (used[i] == 1)
        ++c1;
      else
        ++c2;
      if (kols[gr[i][0]]++) --ans2;
    }
  cout << 1 + 2 * (c1 && c2) << ' ' << ans2 << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
