#include <bits/stdc++.h>
using namespace std;
const int N = 1000 * 100 + 3;
int n, ans1, h[N];
bool par[N], mark[N], vis[N];
vector<int> adj[N];
void input() {
  cin >> n;
  for (int i = 0; i + 1 < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[--u].push_back(--v);
    adj[v].push_back(u);
  }
}
void dfs2(int u) {
  vis[u] = true;
  for (auto v : adj[u])
    if (vis[v] == false) {
      h[v] = h[u] + 1;
      dfs2(v);
    }
  if (adj[u].size() == 1 && h[u] % 2 == 0) ans1 = 3;
}
void dfs1(int u) {
  mark[u] = true;
  for (auto v : adj[u])
    if (mark[v] == false) {
      if (adj[v].size() == 1) par[u] = true;
      dfs1(v);
    }
}
void solve() {
  ans1 = 1;
  for (int i = 0; i < n; i++)
    if (adj[i].size() == 1) {
      dfs1(adj[i][0]);
      dfs2(adj[i][0]);
      return;
    }
}
void output() {
  cout << ans1 << ' ';
  int ans = n - 1;
  for (int i = 0; i < n; i++) {
    if (adj[i].size() == 1) ans--;
    if (par[i] == true) ans++;
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  input(), solve(), output();
  return 0;
}
