#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long MAXN = 2e5 + 5;
const long long INF = 1e18;
const long double PI = acos((long double)-1);
vector<long long> adjlist[MAXN];
long long depth[MAXN], maxx;
void dfs(long long u, long long par, long long dep) {
  depth[u] = dep;
  for (auto v : adjlist[u]) {
    if (v != par) {
      dfs(v, u, dep + 1);
    }
  }
  return;
}
long long ans2 = 0, output;
set<long long> isleaf;
bool check[MAXN];
void dfs2(long long u, long long par, long long dep) {
  for (auto it : adjlist[u]) {
    if (it == par)
      continue;
    else {
      if (dep == 1) {
        if (isleaf.count(it)) {
          continue;
        } else {
          ans2++;
          dfs2(it, u, dep + 1);
        }
      } else if (dep == 0) {
        ans2++;
        dfs2(it, u, dep + 1);
      } else {
        if (isleaf.count(it))
          check[u] = 1;
        else {
          ans2++;
          dfs2(it, u, dep + 1);
        }
      }
    }
  }
  if (check[u]) ans2++;
  output = ans2;
  return;
}
int main() {
  long long n;
  cin >> n;
  for (int i = (1); i <= (n - 1); i++) {
    long long a, b;
    cin >> a >> b;
    adjlist[a].push_back(b);
    adjlist[b].push_back(a);
  }
  bool odd = 0, even = 0;
  bool depthcheck[MAXN];
  memset(depthcheck, 0, sizeof(depthcheck));
  long long ans1, ans2 = 0;
  long long root;
  for (int i = (1); i <= (n); i++) {
    if (adjlist[i].size() == 1) {
      isleaf.insert(i);
      root = i;
    }
  }
  dfs(root, 1, 0);
  for (auto it : isleaf) {
    if (depth[it] & 1) odd = 1;
  }
  if (odd)
    ans1 = 3;
  else
    ans1 = 1;
  dfs2(root, 1, 0);
  cout << ans1 << " " << output;
}
