#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
vector<int> adj[N];
int sum[N];
void dfs1(int node) {
  if (adj[node].size() == 0) sum[node] = 1;
  for (int i = 0; i < adj[node].size(); i++) {
    int a = adj[node][i];
    dfs1(a);
    sum[node] += sum[a];
  }
}
int mx(int node);
int mn(int node);
int Mx(int node);
int Mn(int node);
int mx(int node) {
  if (adj[node].size() == 0) return 1;
  int ret = 1;
  for (int i = 0; i < adj[node].size(); i++) {
    int a = adj[node][i];
    ret = max(ret, sum[node] - sum[a] + mn(a));
  }
  return ret;
}
int mn(int node) {
  if (adj[node].size() == 0) return 1;
  int ret = 0;
  for (int i = 0; i < adj[node].size(); i++) {
    int a = adj[node][i];
    ret += mx(a) - 1;
  }
  return ret + 1;
}
int Mx(int node) {
  if (adj[node].size() == 0) return 1;
  int ret = 0;
  for (int i = 0; i < adj[node].size(); i++) {
    int a = adj[node][i];
    ret += Mn(a);
  }
  return ret;
}
int Mn(int node) {
  if (adj[node].size() == 0) return 1;
  int ret = N;
  for (int i = 0; i < adj[node].size(); i++) {
    int a = adj[node][i];
    ret = min(ret, Mx(a));
  }
  return ret;
}
int main() {
  int n, a, b;
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &a, &b);
    adj[a].push_back(b);
  }
  dfs1(1);
  cout << mx(1) << ' ' << Mx(1);
  return 0;
}
