#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 4;
int n;
vector<int> G[N], leaves;
int par[N], d[N];
int mn, mx;
void dfs(int u, int p) {
  int cnt = 0;
  for (int v : G[u])
    if (v != p) {
      if (G[v].size() == 1) cnt++;
      d[v] = d[u] + 1;
      dfs(v, u);
    }
  cnt--;
  mx -= max(cnt, 0);
}
void solve() {
  for (int i = 1; i <= n; i++)
    if (G[i].size() == 1) leaves.push_back(i);
  mx = n - 1;
  for (int i = 1; i <= n; i++)
    if (G[i].size() != 1) {
      dfs(i, 0);
      break;
    }
  int odd = 0, even = 0;
  for (int x : leaves) {
    if (d[x] % 2 != 0)
      odd = 1;
    else
      even = 1;
  }
  if (!(odd ^ even))
    mn = min(3, n - 1);
  else
    mn = 1;
  cout << mn << " " << mx;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  solve();
  return 0;
}
