#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> child[200005];
int num[200005] = {0};
int calsub(int node) {
  if (child[node].size() == 0) {
    num[node] = 1;
    return 1;
  }
  for (int i = 0; i < child[node].size(); i++) {
    num[node] += calsub(child[node][i]);
  }
  return num[node];
}
int dfsmax(int node, int f) {
  if (child[node].size() == 0) {
    return 1;
  }
  int temp = 0;
  if (f == 0) {
    for (int i = 0; i < child[node].size(); i++) {
      temp = max(temp,
                 num[node] - num[child[node][i]] + dfsmax(child[node][i], 1));
    }
  } else {
    for (int i = 0; i < child[node].size(); i++) {
      temp = temp + dfsmax(child[node][i], 0) - 1;
    }
    temp++;
  }
  return temp;
}
int dfsmin(int node, int f) {
  if (child[node].size() == 0) {
    return 1;
  }
  int temp;
  if (f == 0) {
    temp = 0;
    for (int i = 0; i < child[node].size(); i++) {
      temp = temp + dfsmin(child[node][i], 1);
    }
  } else {
    temp = 10000000;
    for (int i = 0; i < child[node].size(); i++) {
      temp = min(temp, dfsmin(child[node][i], 0));
    }
  }
  return temp;
}
int main() {
  int u, v;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d", &u);
    scanf("%d", &v);
    child[u].push_back(v);
  }
  calsub(1);
  int ans1 = dfsmax(1, 0);
  int ans2 = dfsmin(1, 0);
  printf("%d %d\n", ans1, ans2);
  return 0;
}
