#include <bits/stdc++.h>
using namespace std;
vector<long long int> adj[100001];
long long int n, ma, mi, least, o, e;
void dfs(long long int c, long long int p, long long int d) {
  int b = 0;
  for (int x : adj[c]) {
    if (x != p) {
      dfs(x, c, !d);
      if (adj[x].size() == 1) b++;
    }
  }
  if (adj[c].size() == 1) {
    if (d)
      o = 1;
    else
      e = 1;
  }
  if (b == 1) b--;
  ma += b;
  if (b > 1) mi++;
}
int main() {
  long long int x, y, i;
  cin >> n;
  for (i = 1; i < n; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  ma = mi = 0;
  o = e = 0;
  for (i = 1; i <= n; i++) {
    if (adj[i].size() > 1) {
      dfs(i, 0, 0);
      break;
    }
  }
  if (o && e)
    least = 3;
  else
    least = 1;
  printf("%lld %lld", least, n - 1 - ma + mi);
  return 0;
}
