#include <bits/stdc++.h>
using namespace std;
const long long MOD = 666013;
pair<long long, long long> sum[200001];
int suma2;
int ok = 1;
vector<int> v[200001];
void DFS(int node, int parent) {
  int par = 0;
  for (auto x : v[node]) {
    if (x != parent) {
      DFS(x, node);
      if (v[x].size() == 1) par++;
      sum[node].first += sum[x].second;
      sum[node].second += sum[x].first;
    }
  }
  if (v[parent].size() == 1) par++;
  if (par) suma2 += par - 1;
  if (sum[node].first > 0 && sum[node].second > 0) ok = 0;
}
int main() {
  int n, i;
  cin >> n;
  for (i = 1; i <= n - 1; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int suma = 0;
  for (i = 1; i <= n; i++) {
    if (v[i].size() == 1) sum[i].second = 1;
    suma += (int)v[i].size();
  }
  DFS(1, 0);
  if (ok == 1) {
    cout << 1 << " ";
  } else {
    cout << 3 << " ";
  }
  cout << n - 1 - suma2;
  return 0;
}
