#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj;
vector<int> dep;
void dfs(int u, int p, int d) {
  dep[u] = d;
  for (auto it : adj[u]) {
    if (it != p) dfs(it, u, d + 1);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  adj.resize(n + 1);
  dep.resize(n + 1);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, -1, 0);
  int cnt[2] = {0};
  for (int i = 1; i < n + 1; i++) {
    if (adj[i].size() == 1) cnt[dep[i] % 2]++;
  }
  if (!cnt[1] || !cnt[0])
    cout << 1 << " ";
  else
    cout << 3 << " ";
  vector<int> vis(n + 1, 0);
  int ans = 0;
  for (int i = 1; i < n + 1; i++) {
    if (vis[i]) continue;
    if (adj[i].size() == 1) {
      int p = adj[i][0];
      int cur = 0;
      for (auto it : adj[p]) {
        if (adj[it].size() == 1) {
          vis[it] = 1;
          cur += 1;
        }
      }
      ans += cur - 1;
    }
  }
  cout << n - 1 - ans << endl;
  return 0;
}
