#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 50;
vector<int> a[maxn];
struct node {
  int id;
  int head;
  int flag;
};
int cnt[2] = {0};
void bfs(int s) {
  queue<node> p;
  p.push({s, 0, 0});
  while (!p.empty()) {
    node t = p.front();
    p.pop();
    int i = t.id;
    if (a[i].size() == 1) cnt[t.flag]++;
    for (int j = 0; j < a[i].size(); j++) {
      if (a[i][j] != t.head) {
        p.push({a[i][j], i, t.flag ^ 1});
      }
    }
  }
}
long long max_num;
bool judge(int i) {
  if (a[i].size() == 1) return true;
  return false;
}
void bfs_max(int s) {
  queue<node> p;
  p.push({s, 0, 1});
  while (!p.empty()) {
    node t = p.front();
    p.pop();
    int i = t.id;
    int cnt = 0;
    for (int j = 0; j < a[i].size(); j++) {
      if (judge(a[i][j]))
        cnt++;
      else {
        if (a[i][j] != t.head) {
          p.push({a[i][j], i, t.flag ^ 1});
        }
      }
    }
    if (cnt > 1) max_num -= cnt - 1;
  }
}
int main() {
  long long n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    a[u].push_back(v);
    a[v].push_back(u);
  }
  max_num = n - 1;
  for (int i = 1; i <= n; i++) {
    if (a[i].size() == 1) {
      bfs(i);
      bfs_max(i);
      break;
    }
  }
  long long min_num;
  if (!(cnt[0] && cnt[1]))
    min_num = 1;
  else {
    min_num = 3;
  }
  cout << min_num << ' ' << max_num << endl;
  return 0;
}
