#include <bits/stdc++.h>
using namespace std;
vector<int> v[100001], vis(100001), par(100001), w, dis(100001);
int cnt = 0;
void dfs(int i) {
  vis[i] = 1;
  int e = 0;
  for (auto x : v[i]) {
    if (!vis[x]) {
      e = 1;
      dis[x] = 1 + dis[i];
      cnt++;
      par[x] = i;
      dfs(x);
    }
  }
  if (e == 0) w.push_back(i);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (long long int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(1);
  if (v[1].size() == 1) {
    w.push_back(1);
    par[1] = v[1][0];
  }
  set<int> s;
  int mi = 0;
  for (auto x : w) {
    s.insert(par[x]);
    if (dis[x] % 2) mi++;
  }
  if (mi == w.size() || mi == 0)
    cout << 1 << " ";
  else
    cout << 3 << " ";
  cnt -= (w.size() - s.size());
  cout << cnt;
  return 0;
}
