#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> G[N];
int n;
int d[N], v[N], fa[N], cnt[N], deep[N];
bool has_odd = false;
bool odd[N], even[N];
void dfs(int x, int dep, int f) {
  fa[x] = f;
  deep[x] = dep;
  bool is_leave = 1;
  for (auto y : G[x]) {
    if (y == f) continue;
    dfs(y, dep + 1, x);
    is_leave = 0;
  }
  if (is_leave) {
    cnt[fa[x]]++;
  }
}
void dp(int x, int f) {
  bool is_leave = 1;
  for (auto y : G[x]) {
    if (y == f) continue;
    is_leave = 0;
    dp(y, x);
    if (even[y]) odd[x] = 1;
    if (odd[y]) even[x] = 1;
  }
  if (is_leave) {
    odd[x] = 0;
    even[x] = 1;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  int root = 1;
  for (int i = 1; i <= n; i++) {
    if (G[i].size() > 1) root = i;
  }
  dfs(root, 0, 0);
  dp(root, 0);
  int ans = 1;
  for (int i = 1; i <= n; i++) {
    if (odd[i] && even[i]) {
      ans = 3;
    }
  }
  cout << ans << " ";
  ans = n - 1;
  for (int i = 1; i <= n; i++) {
    if (cnt[i]) ans -= cnt[i] - 1;
  }
  cout << ans << endl;
  return 0;
}
