#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
vector<vector<long long>> A;
vector<long long> vis;
vector<long long> col;
void DFS(long long v, long long c) {
  col[v] = c;
  vis[v] = +1;
  for (long long i = 0; i < A[v].size(); i++) {
    if (vis[A[v][i]] == 0) {
      DFS(A[v][i], -c);
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long T = 1;
  for (long long iii = 0; iii < T; iii++) {
    long long n;
    cin >> n;
    vector<long long> w;
    vector<long long> deg;
    for (long long i = 0; i <= n; i++) {
      A.push_back(w);
      deg.push_back(0);
      vis.push_back(0);
      col.push_back(0);
    }
    for (long long i = 0; i < n - 1; i++) {
      long long a, b;
      cin >> a >> b;
      A[a].push_back(b);
      A[b].push_back(a);
      deg[a]++;
      deg[b]++;
    }
    long long n_out = n;
    for (long long i = 0; i <= n; i++) {
      if (deg[i] == 1) {
        long long b = A[i][0];
        for (long long j = 0; j < deg[b]; j++) {
          if (deg[A[b][j]] == 1 and A[b][j] != i) {
            n_out--;
            deg[A[b][j]]--;
          }
        }
      }
    }
    DFS(1, 1);
    bool flag = false, flag3 = false;
    long long c_tmp;
    for (long long i = 0; i <= n; i++) {
      if (deg[i] == 1) {
        if (flag == false) {
          c_tmp = col[i];
          flag = true;
        } else {
          if (c_tmp != col[i]) {
            flag3 = true;
            break;
          }
        }
      }
    }
    if (flag3 == false) {
      cout << 1 << " " << n_out - 1 << endl;
    } else {
      cout << 3 << " " << n_out - 1 << endl;
    }
  }
  return 0;
}
