#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
int depth[MAXN], ind[MAXN];
struct Edge {
  int to, next;
} edges[MAXN];
int te = 0;
int par[MAXN] = {0};
inline void addE(int u, int v) {
  edges[++te].to = v, edges[te].next = par[u];
  par[u] = te;
  ind[v]++;
}
int ans = 0, n;
void dfs(int u, int fa) {
  int cnt = 0;
  for (int e = par[u]; e; e = edges[e].next) {
    int v = edges[e].to;
    if (v != fa) {
      depth[v] = depth[u] + 1;
      dfs(v, u);
    }
    if (ind[v] == 1) cnt++;
  }
  if (cnt > 0) ans -= (cnt - 1);
}
int st;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    addE(u, v), addE(v, u);
  }
  for (int i = 1; i <= n; ++i) {
    if (ind[i] >= 2) {
      st = i;
      break;
    }
  }
  if (!st) {
    cout << 1 << endl;
    return 0;
  }
  dfs(st, -1);
  bool mark0 = 0, mark1 = 0;
  for (int i = 1; i <= n; ++i) {
    if (ind[i] == 1) {
      if (depth[i] & 1)
        mark1 = 1;
      else
        mark0 = 1;
    }
  }
  if (mark1 && mark0)
    cout << 3 << " ";
  else
    cout << 1 << " ";
  cout << ans + n - 1 << endl;
  return 0;
}
