#include <bits/stdc++.h>
using namespace std;
bool hasEvenLeaf[100001];
bool hasOddLeaf[100001];
bool seen[100001];
bool isLeaf[100001];
int leafCount[100001];
vector<long long> adj[100001];
void bfs(int x) {
  if (adj[x].size() == 1) {
    isLeaf[x] = true;
    hasEvenLeaf[x] = true;
  }
  seen[x] = true;
  for (auto it : adj[x]) {
    if (!seen[it]) {
      bfs(it);
    }
  }
  for (auto it : adj[x]) {
    if (hasEvenLeaf[it]) hasOddLeaf[x] = true;
    if (hasOddLeaf[it]) hasEvenLeaf[x] = true;
    if (hasEvenLeaf[x]) hasOddLeaf[it] = true;
    if (hasOddLeaf[x]) hasEvenLeaf[it] = true;
  }
}
void bfs2(int x) {
  if (isLeaf[x]) {
    hasEvenLeaf[x] = true;
  }
  seen[x] = true;
  for (auto it : adj[x]) {
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long a, b;
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  memset(hasOddLeaf, false, sizeof(hasOddLeaf));
  memset(hasEvenLeaf, false, sizeof(hasEvenLeaf));
  memset(seen, false, sizeof(seen));
  memset(isLeaf, false, sizeof(isLeaf));
  memset(leafCount, 0, sizeof(leafCount));
  bfs(0);
  long long minAns = 1;
  for (int i = 0; i < n; i++) {
    if (hasEvenLeaf[i] && hasOddLeaf[i]) {
      minAns = 3;
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    for (auto it : adj[i]) {
      if (isLeaf[it]) leafCount[i]++;
    }
  }
  long long maxAns = n - 1;
  for (int i = 0; i < n; i++) {
    maxAns -= max((leafCount[i] - 1), 0);
  }
  cout << minAns << " " << maxAns << '\n';
}
