#include <bits/stdc++.h>
using namespace std;
std::vector<int> adj[210000];
bool vis[210000], vis1[210000];
int ans, cnt[210000];
int dfs(int curr, int h) {
  int temp2 = 0, i, temp1 = 10000000, temp;
  if (adj[curr].size() == 0) return 1;
  for (i = 0; i < adj[curr].size(); i++) {
    temp = dfs(adj[curr][i], h + 1);
    temp1 = min(temp1, temp);
    temp2 += temp;
  }
  ans = temp2 - adj[curr].size();
  if (h & 1)
    return temp2;
  else
    return temp1;
}
int dfs1(int curr, int h) {
  int temp2 = 0, i, temp1 = 10000000, temp, gap = 10000000;
  if (adj[curr].size() == 0) {
    cnt[curr] = 1;
    return 1;
  }
  for (i = 0; i < adj[curr].size(); i++) {
    temp = dfs1(adj[curr][i], h + 1);
    cnt[curr] += cnt[adj[curr][i]];
    gap = min(gap, cnt[adj[curr][i]] - temp);
    temp2 += temp;
  }
  temp2 = temp2 - adj[curr].size() + 1;
  if (h & 1)
    return cnt[curr] - gap;
  else
    return temp2;
}
int main() {
  int n, i, temp1, temp2, curr, m = 0;
  scanf("%d", &n);
  for (i = 0; i < n - 1; i++) {
    scanf("%d", &temp1);
    scanf("%d", &temp2);
    adj[temp1].push_back(temp2);
    vis[temp2]++;
    vis1[temp1]++;
  }
  for (i = 0; i < n; i++) {
    if (vis[i + 1] == 0) curr = i + 1;
    if (vis1[i + 1] == 0) m++;
  }
  printf("%d ", m - dfs(curr, 0) + 1);
  printf("%d\n", m - dfs1(curr, 0) + 1);
}
