#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Vi = vector<int>;
using Pii = pair<int, int>;
int uplg(int n) { return 32 - __builtin_clz(n); }
int uplg(ll n) { return 64 - __builtin_clzll(n); }
void run();
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(18);
  run();
  return 0;
}
vector<Vi> G;
Vi depth, par;
void dfs(int v, int p, int d) {
  par[v] = p;
  depth[v] = d;
  for (auto& e : (G[v]))
    if (e != p) {
      dfs(e, v, d + 1);
    }
}
void run() {
  int n;
  cin >> n;
  G.resize(n);
  for (int i = (1); i < (n); i++) {
    int a, b;
    cin >> a >> b;
    G[a - 1].push_back(b - 1);
    G[b - 1].push_back(a - 1);
  }
  int root = -1;
  for (int i = (0); i < (n); i++) {
    if (int((G[i]).size()) >= 2) {
      root = i;
      break;
    }
  }
  assert(root != -1);
  depth.resize(n, -1);
  par.resize(n, -1);
  dfs(root, -1, 0);
  bool has[2] = {0};
  for (int i = (0); i < (n); i++) {
    if (int((G[i]).size()) == 1) {
      has[depth[i] % 2] = 1;
    }
  }
  int minF = (has[0] && has[1] ? 3 : 1);
  int maxF = n - 1;
  vector<bool> seen(n);
  for (int i = (0); i < (n); i++) {
    if (int((G[i]).size()) == 1) {
      if (seen[par[i]]) maxF--;
      seen[par[i]] = 1;
    }
  }
  cout << minF << ' ' << maxF << '\n';
}
