#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 5;
const long long mod = 1e9 + 7;
long long powermodm(long long x, long long n, long long M) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % M;
    x = (x * x) % M;
    n = n / 2;
  }
  return result;
}
long long power(long long x, long long y) {
  long long z = 1;
  while (y) {
    if (y % 2 == 1) z = (z * x);
    y /= 2;
    x = (x * x);
  }
  return z;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) {
  return (max(a, b) / gcd(a, b)) * min(a, b);
}
set<long long> s;
long long edges, leaves, extra;
vector<long long> edg[100001];
void dfs(long long u, long long p, long long lev) {
  bool flag = false;
  for (long long i = 0; i < edg[u].size(); i++) {
    if (edg[u][i] == p) continue;
    dfs(edg[u][i], u, lev + 1);
    edges++;
    if (edg[edg[u][i]].size() == 1) flag = true;
  }
  if (flag) extra++;
  if (edg[u].size() == 1) {
    s.insert(lev % 2);
    leaves++;
  }
}
int main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    long long x, y;
    cin >> x >> y;
    edg[x].push_back(y);
    edg[y].push_back(x);
  }
  long long root;
  for (long long i = 1; i <= n; i++) {
    if (edg[i].size() > 1) root = i;
  }
  dfs(root, 0, 0);
  long long ans1, ans2;
  ans2 = edges - leaves + extra;
  if (s.size() == 1)
    ans1 = 1;
  else
    ans1 = 3;
  cout << ans1 << " " << ans2 << endl;
  return 0;
}
