#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const int INF2 = 0x3f3f3f3f;
const long long INF64 = 0x3f3f3f3f3f3f3f3f;
const double PI = 3.14159265358979323846;
const long long MOD = 1e9 + 7;
const long long TARGET = (1LL << 32) - 1LL;
template <typename T>
T Max(T val1, T val2) {
  return val1 > val2 ? val1 : val2;
}
template <typename T, typename... Args>
T Max(T val, Args... arg) {
  T result = Max(arg...);
  return Max(val, result);
}
template <typename T>
inline T read() {
  T X = 0, w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  return w ? -X : X;
}
const int MAXN = 500005;
int n, m, k;
int deg[MAXN];
vector<int> G[MAXN];
int dep[MAXN];
int ans;
void dfs(int u, int p) {
  int cnt = 0;
  for (auto v : G[u]) {
    if (v == p) continue;
    dep[v] = dep[u] + 1;
    dfs(v, u);
    if (deg[v] == 1) cnt++;
  }
  ans -= max(0, cnt - 1);
}
void solve() {
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v), G[v].push_back(u);
    deg[u]++, deg[v]++;
  }
  int rt = 1;
  for (int i = 1; i <= n; i++) {
    if (deg[i] != 1) {
      rt = i;
      break;
    }
  }
  ans = n - 1;
  dfs(rt, rt);
  int odd = -1;
  bool flag = false;
  for (int i = 1; i <= n; i++) {
    if (deg[i] == 1) {
      if (odd < 0)
        odd = dep[i] & 1;
      else if ((dep[i] & 1) != odd) {
        flag = true;
      }
    }
  }
  if (flag) {
    printf("3 %d\n", ans);
  } else {
    printf("1 %d\n", ans);
  }
}
int main() {
  solve();
  return 0;
}
