#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 10;
const long long mod = 2e18 + 7;
const int maxn = 1e5 + 7;
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + (c - '0');
    c = getchar();
  }
  return x * f;
}
int head[maxn << 1];
struct Edge {
  int to, next;
} edge[maxn << 1];
int tot;
void init() {
  memset(head, -1, sizeof(head));
  tot = 0;
}
void addedge(int u, int v) {
  edge[tot].to = v;
  edge[tot].next = head[u];
  head[u] = tot++;
}
long long qpow(long long a, long long b, long long p) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % p;
    a = (a * a) % p;
    b >>= 1;
  }
  return res;
}
int deg[maxn];
int imin, imax;
void dfs(int u, int fa, int len) {
  if (deg[u] == 1) {
    if (len) imin = 3;
  }
  for (int i = head[u]; i != -1; i = edge[i].next) {
    int v = edge[i].to;
    if (v == fa) continue;
    dfs(v, u, len ^ 1);
  }
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    init();
    memset(deg, 0, sizeof(deg));
    for (int i = (1); i <= (n - 1); i++) {
      int u, v;
      scanf("%d", &u), scanf("%d", &v);
      addedge(u, v), addedge(v, u);
      deg[u]++, deg[v]++;
    }
    imin = 1;
    for (int i = (1); i <= (n); i++) {
      if (deg[i] == 1) {
        dfs(i, 0, 0);
        break;
      }
    }
    imax = n - 1;
    for (int u = (1); u <= (n); u++) {
      int res = 0;
      for (int i = head[u]; i != -1; i = edge[i].next) {
        int v = edge[i].to;
        if (deg[v] == 1) {
          res++;
        }
      }
      if (res) imax -= res - 1;
    }
    printf("%d %d\n", imin, imax);
  }
  return 0;
}
