#include <bits/stdc++.h>
const long long int MOD = 1e9 + 7;
const long long int INF = 1011111111;
const long long int LLINF = 1000111000111000111LL;
const long double EPS = 1e-10;
const long double PI = 3.14159265358979323;
using namespace std;
long long int power(long long int base, long long int exponent) {
  long long int ans = 1;
  while (exponent != 0) {
    if (exponent & 1) ans = (1LL * ans * base);
    base = (1LL * base * base);
    exponent >>= 1;
  }
  return ans;
}
const long long int N = 1e5 + 5;
vector<long long int> v[N];
bool visit[N];
long long int leaves = 0;
long long int level[N];
void dfs(long long int node, long long int x) {
  visit[node] = true;
  level[node] = x;
  for (auto to : v[node]) {
    if (!visit[to]) {
      dfs(to, x + 1);
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m, i, j, k;
  cin >> n;
  for (i = 0; i < n - 1; i++) {
    long long int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  vector<long long int> tt;
  set<long long int> xx;
  for (i = 1; i <= n; i++) {
    if (v[i].size() == 1) {
      leaves++;
      tt.push_back(i);
      xx.insert(v[i][0]);
    }
  }
  long long int maxi = (long long int)xx.size() + (n - leaves) - 1;
  dfs(tt[0], 1);
  vector<long long int> y;
  for (i = 0; i < (long long int)tt.size(); i++) {
    y.push_back(level[tt[i]]);
  }
  sort(y.begin(), y.end());
  bool ok = false;
  long long int mini;
  for (i = 0; i < (long long int)y.size(); i++)
    if (y[i] % 2 == 0) ok = true;
  if (ok)
    mini = 3;
  else
    mini = 1;
  cout << mini << " " << maxi;
  cerr << '\n'
       << "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms"
       << '\n';
}
