#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > Adj_List;
vector<vector<int> > children;
vector<int> parent;
vector<int> max_ans;
vector<int> min_ans;
vector<int> leaf_count;
void list_child(int k) {
  if (Adj_List[k].size() == 1 && k != 1) {
    leaf_count[k] = 1;
  } else {
    for (int i = 0; i < Adj_List[k].size(); i++) {
      if (Adj_List[k][i] != parent[k]) {
        children[k].push_back(Adj_List[k][i]);
        parent[Adj_List[k][i]] = k;
        list_child(Adj_List[k][i]);
        leaf_count[k] += leaf_count[Adj_List[k][i]];
      }
    }
  }
}
void solve(int k, int parity) {
  if (children[k].size() == 0) {
    max_ans[k] = 1;
    min_ans[k] = 1;
  } else if (parity == 1) {
    int min_wasted = 999999999;
    int tot_wasted = 0;
    for (int i = 0; i < children[k].size(); i++) {
      solve(children[k][i], 0);
      int wasted_max = leaf_count[children[k][i]] - max_ans[children[k][i]];
      if (wasted_max < min_wasted) {
        min_wasted = wasted_max;
      }
      int wasted_min = leaf_count[children[k][i]] - min_ans[children[k][i]];
      tot_wasted += wasted_min;
    }
    max_ans[k] = leaf_count[k] - min_wasted;
    min_ans[k] = leaf_count[k] - tot_wasted;
  } else {
    int tot_skipped = 0;
    int min_skipped = 999999999;
    for (int i = 0; i < children[k].size(); i++) {
      solve(children[k][i], 1);
      int skipped_max = max_ans[children[k][i]] - 1;
      int skipped_min = min_ans[children[k][i]] - 1;
      tot_skipped += skipped_max;
      if (skipped_min < min_skipped) {
        min_skipped = skipped_min;
      }
    }
    max_ans[k] = tot_skipped + 1;
    min_ans[k] = min_skipped + 1;
  }
}
int main() {
  int N;
  cin >> N;
  for (int i = 0; i <= N; i++) {
    vector<int> empty;
    Adj_List.push_back(empty);
    children.push_back(empty);
    parent.push_back(-1);
    max_ans.push_back(-1);
    min_ans.push_back(-1);
    leaf_count.push_back(0);
  }
  for (int i = 0; i < N - 1; i++) {
    int A, B;
    cin >> A >> B;
    Adj_List[A].push_back(B);
    Adj_List[B].push_back(A);
  }
  list_child(1);
  solve(1, 1);
  cout << max_ans[1] << " " << min_ans[1] << endl;
}
