#include <bits/stdc++.h>
using namespace std;
void solve();
void solveA();
void solveB();
void solveC();
void solveD();
void solveE();
void solveF();
void solveG();
void solveTests() {
  int nTests;
  cin >> nTests;
  for (int i = 0; i < nTests; i++) {
    solve();
  }
}
template <typename T>
T get_max_in_vector(vector<T> &v) {
  T mx = v[0];
  for (T tmp : v) mx = max(mx, tmp);
  return mx;
}
template <typename T>
T get_min_in_vector(vector<T> &v) {
  T mn = v[0];
  for (T tmp : v) mn = min(mn, tmp);
  return mn;
}
int main() {
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
void solve() { solveA(); }
void informatics_282() {}
vector<int> g[(int)1e5];
bool been[(int)1e5];
int l[(int)1e5];
int n;
bool leafs_are_even = false;
bool leafs_are_odd = false;
void dfs(int vertex, int level) {
  if (been[vertex]) return;
  been[vertex] = true;
  if (g[vertex].size() == 1) {
    if (level % 2 == 0)
      leafs_are_even = true;
    else
      leafs_are_odd = true;
  }
  for (int i = 0; i < g[vertex].size(); i++) {
    if (!been[g[vertex][i]]) dfs(g[vertex][i], level + 1);
  }
}
int get_num_child_leafs(int vert) {
  int count = 0;
  for (int i = 0; i < g[vert].size(); i++) {
    count += (g[g[vert][i]].size() == 1);
  }
  return count;
}
void solveA() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  int mx = n - 1;
  dfs(0, 0);
  for (int i = 0; i < n; i++) {
    int ncl = get_num_child_leafs(i);
    if (ncl > 1) mx -= ncl - 1;
  }
  int mn = (leafs_are_odd && leafs_are_even) ? 3 : 1;
  cout << mn << " " << mx << endl;
}
void solveB() {}
void solveC() {}
void solveD() {}
void solveE() {}
