#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1}, ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
void mad(long long &a, long long b) {
  a = (a + b) % 1000000007;
  if (a < 0) a += 1000000007;
}
long long gcd(long long a, long long b) {
  if (!a) return b;
  return gcd(b % a, a);
}
int n;
int ans;
int d[100005];
vector<int> ed[100005];
void dfs(int i, int h, int p) {
  d[i] = h;
  int cnt = 0;
  for (int j : ed[i]) {
    if (j == p) continue;
    if (ed[j].size() == 1) cnt++;
    dfs(j, h + 1, i);
  }
  if (cnt) ans = ans - cnt + 1;
}
void solve() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    ed[u].push_back(v);
    ed[v].push_back(u);
  }
  int root = 1;
  for (int i = 1; i <= n; i++)
    if (ed[i].size() > 1) {
      root = i;
      break;
    }
  dfs(root, 0, 0);
  int e = 0, o = 0;
  for (int i = 1; i <= n; i++) {
    if (ed[i].size() == 1) {
      if (d[i] & 1)
        o = 1;
      else
        e = 1;
    }
  }
  if (e & o)
    cout << 3 << " ";
  else
    cout << 1 << " ";
  ans += n - 1;
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
