#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1.01e9;
const long long infll = (long long)1.01e18;
const long double eps = 1e-9;
const long double pi = acos((long double)-1);
mt19937 mrand(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int x) { return mrand() % x; }
void precalc() {}
const int maxn = (int)1e5 + 5;
int n;
vector<int> g[maxn];
bool read() {
  if (scanf("%d", &n) < 1) {
    return false;
  }
  for (int i = 0; i < n; i++) {
    g[i].clear();
  }
  for (int i = 0; i < n - 1; i++) {
    int v, u;
    scanf("%d%d", &v, &u);
    v--;
    u--;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  return true;
}
int col[maxn];
void dfs(int v, int p) {
  for (int i = 0; i < ((int)(g[v]).size()); i++) {
    int u = g[v][i];
    if (u == p) {
      continue;
    }
    col[u] = (col[v] ^ 1);
    dfs(u, v);
  }
}
int used[maxn];
void solve() {
  col[0] = 0;
  dfs(0, -1);
  int cols = 0;
  for (int v = 0; v < n; v++) {
    if (((int)(g[v]).size()) != 1) {
      continue;
    }
    cols |= (1 << col[v]);
  }
  int mn = (cols == 3 ? 3 : 1);
  int mx = n - 1;
  for (int v = 0; v < n; v++) {
    used[v] = false;
  }
  for (int v = 0; v < n; v++) {
    if (((int)(g[v]).size()) != 1) {
      continue;
    }
    int u = g[v][0];
    if (used[u]) {
      mx--;
    }
    used[u] = true;
  }
  printf("%d %d\n", mn, mx);
}
int main() {
  precalc();
  while (read()) {
    solve();
  }
  return 0;
}
