#include <bits/stdc++.h>
using namespace std;
void dfs(vector<int> e[], int x, int p, int h[], int dp[]) {
  bool haslf = false;
  dp[x] = 0;
  for (int y : e[x]) {
    if (y != p) {
      h[y] = h[x] + 1;
      dfs(e, y, x, h, dp);
      dp[x] += dp[y];
      if (e[y].size() == 1) {
        if (!haslf) {
          dp[x]++;
          haslf = true;
        }
      } else {
        dp[x]++;
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> e[n];
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  int rt, lf;
  for (int i = 0; i < n; i++) {
    if (e[i].size() > 1) {
      rt = i;
    } else {
      lf = i;
    }
  }
  int h[n];
  h[rt] = 0;
  int dp[n];
  dfs(e, rt, -1, h, dp);
  int ans1 = 1;
  for (int i = 0; i < n; i++) {
    if (e[i].size() == 1 && h[i] % 2 != h[lf] % 2) {
      ans1 = 3;
    }
  }
  cout << ans1 << " " << dp[rt] << endl;
  return 0;
}
