#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
using namespace std;
template <typename T>
void uin(T &a, T b) {
  if (b < a) {
    a = b;
  }
}
template <typename T>
void uax(T &a, T b) {
  if (b > a) {
    a = b;
  }
}
const long long N = 100 * 1000 + 228;
vector<long long> g[N];
long long deg[N];
long long h[N], p[N];
void dfs(long long v, long long par = -1) {
  h[v] = (par == -1 ? 0 : h[par] + 1);
  p[v] = par;
  for (long long to : g[v]) {
    if (to != par) dfs(to, v);
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n - 1; ++i) {
    long long u, v;
    cin >> u >> v;
    ++deg[u];
    ++deg[v];
    g[u].emplace_back(v);
    g[v].emplace_back(u);
  }
  long long root = 1;
  for (long long i = 1; i <= n; ++i) {
    if (deg[i] > 1) {
      root = i;
      break;
    }
  }
  dfs(root);
  bool even = 0, odd = 0;
  for (long long i = 1; i <= n; ++i) {
    if (deg[i] == 1) {
      if (h[i] & 1)
        odd = 1;
      else
        even = 1;
    }
  }
  long long min_colors = 0;
  if (even && odd) {
    min_colors = 3;
  } else {
    min_colors = 1;
  }
  vector<long long> pars;
  long long leafs = 0;
  for (long long i = 1; i <= n; ++i) {
    if (deg[i] == 1) {
      pars.emplace_back(p[i]);
      ++leafs;
    }
  }
  sort(pars.begin(), pars.end());
  pars.erase(unique(pars.begin(), pars.end()), pars.end());
  long long max_colors = (long long)pars.size();
  max_colors += (n - 1 - leafs);
  cout << min_colors << ' ' << max_colors << '\n';
  return 0;
}
