#include <bits/stdc++.h>
using namespace std;
void fastIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
const int MAXN = 1e5 + 5;
vector<int> G[MAXN];
int small = 1, wasted;
bool is_leaf(const int &u) { return (int)G[u].size() == 1; }
void dfs(int u, int parent, bool depth) {
  if (is_leaf(u) && depth) small = 3;
  int children_leaves = is_leaf(parent);
  for (const int &v : G[u])
    if (v != parent) {
      dfs(v, u, depth ^ 1);
      children_leaves += is_leaf(v);
    }
  if (children_leaves > 1) wasted += children_leaves - 1;
}
void solve() {
  int N;
  cin >> N;
  for (int i = 1; i < N; ++i) {
    int u, v;
    cin >> u >> v;
    G[u].emplace_back(v);
    G[v].emplace_back(u);
  }
  for (int u = 1; u <= N; ++u)
    if (is_leaf(u)) {
      dfs(u, 0, false);
      break;
    }
  cout << small << ' ' << N - 1 - wasted << '\n';
}
int main() {
  fastIO();
  solve();
  return 0;
}
