#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 0;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar()) f = ch == '-';
  for (; isdigit(ch); ch = getchar()) x = (x << 3) + (x << 1) + (ch ^ 48);
  return f ? -x : x;
}
inline long long Max(long long a, long long b) { return a > b ? a : b; }
inline long long Min(long long a, long long b) { return a > b ? b : a; }
inline long long Abs(long long x) { return x > 0 ? x : -x; }
inline void put(long long x) {
  if (x >= 10) put(x / 10), putchar((x % 10) ^ 48);
  if (x >= 0 && x <= 9) putchar(x ^ 48);
}
inline void print(long long x, char ch = '\n') {
  if (x < 0) putchar('-'), x = -x;
  put(x), putchar(ch);
}
long long n;
long long dep[100005];
vector<long long> ed[100005];
long long du[100005], flag0, flag1, cnt;
inline void dfs(long long x, long long la) {
  dep[x] = dep[la] + 1;
  long long k = 0;
  for (register long long i = 0; i < ed[x].size(); i++)
    if (du[ed[x][i]] == 1) k++;
  if (k != 0) cnt += (k - 1);
  for (register long long i = 0; i < ed[x].size(); i++)
    if (la != ed[x][i]) dfs(ed[x][i], x);
}
signed main() {
  n = read();
  for (register long long i = 1; i < n; i++) {
    long long u = read(), v = read();
    ed[u].push_back(v);
    ed[v].push_back(u);
    du[u]++;
    du[v]++;
  }
  for (register long long i = 1; i <= n; i++)
    if (du[i] != 1) {
      dfs(i, 0);
      break;
    }
  for (register long long i = 1; i <= n; i++) {
    if (du[i] == 1) {
      if (dep[i] % 2 == 0)
        flag0 = 1;
      else
        flag1 = 1;
    }
  }
  if (flag0 && flag1)
    print(3, ' ');
  else
    print(1, ' ');
  long long ans = n - 1 - cnt;
  print(ans);
  return 0;
}
