#include <bits/stdc++.h>
using namespace std;
struct node {
  long long nod, d;
  node(long long a, long long b) {
    nod = a;
    d = b;
  }
  bool operator<(const node &p) const { return p.d < d; }
};
long long Set(long long n, long long pos) { return n = n | (1LL << pos); }
long long reset(long long n, long long pos) { return n = n & ~(1LL << pos); }
bool check(long long n, long long pos) { return (bool)(n & (1LL << pos)); }
long long power(long long x, long long y) {
  long long res = 1;
  x = x;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long n;
long long depth[100005];
bool isLeaf[100005];
vector<long long> graph[100005];
long long deg[100005];
void dfs(long long src, long long par, long long dep) {
  depth[src] = dep;
  for (long long i = 0; i < graph[src].size(); i++) {
    long long adj = graph[src][i];
    if (adj != par) {
      dfs(adj, src, dep + 1);
    }
  }
}
long long dfs2(long long src, long long par) {
  long long ret = 0;
  bool isLe = 0;
  for (long long i = 0; i < graph[src].size(); i++) {
    long long adj = graph[src][i];
    if (adj != par) {
      if (isLeaf[adj]) {
        isLe = 1;
        continue;
      } else {
        ret += (1 + dfs2(adj, src));
      }
    }
  }
  if (isLe) ret++;
  return ret;
}
int main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n - 1; i++) {
    long long u, v;
    scanf("%lld", &u);
    scanf("%lld", &v);
    graph[u].push_back(v);
    graph[v].push_back(u);
    deg[u]++;
    deg[v]++;
  }
  dfs(1, -1, 0);
  long long lowest_cnt;
  bool is_odd = 0;
  bool is_even = 0;
  long long now_src;
  for (long long i = 1; i <= n; i++) {
    if (deg[i] == 1) {
      isLeaf[i] = 1;
      if (depth[i] % 2)
        is_odd = 1;
      else
        is_even = 1;
    } else {
      isLeaf[i] = 0;
      now_src = i;
    }
  }
  if (is_odd && is_even)
    lowest_cnt = 3;
  else
    lowest_cnt = 1;
  long long highest_cnt = dfs2(now_src, -1);
  cout << lowest_cnt << " " << highest_cnt << endl;
  return 0;
}
