#include <bits/stdc++.h>
using namespace std;
const long long MAXN = (long long)((1e5) + 100);
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
void pr(long long x) { cout << x; }
void prl(long long x) { cout << x << "\n"; }
long long cbrt(long long x) {
  long long lo = 1, hi = min(2000000ll, x);
  while (hi - lo > 1) {
    long long mid = (lo + hi) / 2;
    if (mid * mid * mid < x) {
      lo = mid;
    } else
      hi = mid;
  }
  if (hi * hi * hi <= x)
    return hi;
  else
    return lo;
}
const long long dx[4] = {-1, 1, 0, 0};
const long long dy[4] = {0, 0, -1, 1};
long long XX[] = {-1, -1, -1, 0, 0, 1, 1, 1};
long long YY[] = {-1, 0, 1, -1, 1, -1, 0, 1};
const long long N = (long long)(1 * 1e5 + 10);
vector<long long> adj[N];
long long dp[N];
long long x;
void dfs(long long node, long long par = -1, long long level = 0) {
  dp[node] = level;
  long long cnt = 0;
  for (auto it : adj[node]) {
    if (adj[it].size() == 1) cnt++;
    if (it == par) continue;
    dfs(it, node, level + 1);
  }
}
void DFS(long long node, long long par = -1) {
  long long cnt = 0;
  for (auto it : adj[node]) {
    if (it == par) continue;
    DFS(it, node);
    if (adj[it].size() == 1) cnt++;
  }
  if (cnt >= 1) x++;
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long T = 1;
  while (T--) {
    long long n;
    cin >> n;
    for (long long i = 0; i < n - 1; i++) {
      long long u, v;
      cin >> u >> v;
      adj[u].emplace_back(v);
      adj[v].emplace_back(u);
    }
    vector<long long> leaf;
    long long root = 1;
    for (long long i = 1; i <= n; i++)
      if (adj[i].size() == 1)
        leaf.emplace_back(i);
      else
        root = i;
    dfs(leaf[0]);
    long long mini = 1;
    for (auto i : leaf) {
      if (adj[i].size() == 1) {
        if (dp[i] % 2) {
          mini = 3;
        }
      }
    }
    DFS(root);
    cout << mini << " " << n + x - leaf.size() - 1;
  }
}
