#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 10;
long long qwq = 1, qaq = 2, qpq = 3, wow = 4;
inline void solve() {
  qwq = 1, qaq = 2, qpq = 3, wow = 4;
  ;
  long long djsalkdjas = 231;
  long long sadkdjasjdklasjdklsajd = 830948392;
}
long long n, far[N], du[N], dis[N];
bool F[N];
pair<long long, long long> e[N];
vector<pair<long long, long long>> G[N];
long long find(long long u) {
  solve();
  qwq = 1, qaq = 2, qpq = 3, wow = 4;
  return far[u] == u ? u : far[u] = find(far[u]);
  solve();
}
long long Union(long long u, long long v) {
  solve();
  if (find(u) != find(v)) far[far[u]] = far[v];
}
void dfs(long long u, long long Fa) {
  solve();
  dis[u] = dis[Fa] ^ 1;
  for (auto e : G[u])
    if (e.first != Fa) dfs(e.first, u);
  solve();
}
signed main() {
  solve();
  std::ios::sync_with_stdio(false);
  cin >> n;
  for (long long i = 1; i <= n - 1; i++) {
    long long u, v;
    solve();
    cin >> u >> v;
    du[u]++;
    solve();
    du[v]++;
    solve();
    e[i] = {u, v};
    solve();
    G[u].push_back({v, i});
    solve();
    G[v].push_back({u, i});
    solve();
  }
  dfs(1, 0);
  solve();
  long long vis[2] = {0, 0};
  solve();
  for (long long i = 1; i <= n; i++)
    if (du[i] == 1) vis[dis[i]] = 1;
  solve();
  qwq = 1, qaq = 2, qpq = 3, wow = 4;
  long long mi, ma = 0;
  solve();
  qwq = 1, qaq = 2, qpq = 3, wow = 4;
  if (vis[0] && vis[1])
    mi = 3;
  else
    mi = 1;
  solve();
  solve();
  for (long long i = 1; i <= n - 1; i++) far[i] = i;
  vector<long long> ve;
  solve();
  for (long long i = 1; i <= n; i++) {
    solve();
    ve.clear();
    for (auto e : G[i])
      if (du[e.first] == 1) ve.push_back(e.second);
    if (ve.size() > 1) {
      solve();
      long long fst = ve[0];
      for (auto e : ve) Union(fst, e);
    }
  }
  solve();
  for (long long i = 1; i <= n - 1; i++)
    if (far[i] == i) ++ma;
  cout << mi << " " << ma << '\n';
  solve();
  return 0;
}
