#include <bits/stdc++.h>
using namespace std;
using LL = long long;
namespace _buff {
const size_t BUFF = 1 << 19;
char ibuf[BUFF], *ib = ibuf, *ie = ibuf;
char getc() {
  if (ib == ie) {
    ib = ibuf;
    ie = ibuf + fread(ibuf, 1, BUFF, stdin);
  }
  return ib == ie ? -1 : *ib++;
}
}  // namespace _buff
LL read() {
  using namespace _buff;
  LL ret = 0;
  bool pos = true;
  char c = getc();
  for (; (c < '0' || c > '9') && c != '-'; c = getc()) {
    assert(~c);
  }
  if (c == '-') {
    pos = false;
    c = getc();
  }
  for (; c >= '0' && c <= '9'; c = getc()) {
    ret = (ret << 3) + (ret << 1) + (c ^ 48);
  }
  return pos ? ret : -ret;
}
const size_t N = 1e5 + 5;
int ans1, ans2;
vector<int> g[N];
bool dfs(int u, int p = 0, int d = 1) {
  if (g[u].size() == 1) {
    ans1 |= d;
    return true;
  }
  bool flag = false;
  for (int v : g[u]) {
    if (v == p) continue;
    flag |= dfs(v, u, d ^ 3);
  }
  ans2 += flag + 1;
  return false;
}
int main() {
  int n = read();
  for (int i = 1; i < n; ++i) {
    int u = read(), v = read();
    g[u].emplace_back(v);
    g[v].emplace_back(u);
  }
  for (int i = 1; i <= n; ++i) {
    if (g[i].size() > 1) {
      assert(!dfs(i));
      break;
    }
  }
  if (ans1 == 2) ans1 = 1;
  cout << ans1 << ' ' << ans2 - 1;
  return 0;
}
