#include <bits/stdc++.h>
using namespace std;
vector<int> edge[200010];
int dist[200010], dp[200010], num[200010];
void dfs1(int u) {
  if (edge[u].size() == 0) {
    dp[u] = 1;
    num[u] = 1;
    return;
  }
  for (int i = 0; i < edge[u].size(); i++) {
    dist[edge[u][i]] = dist[u] + 1;
    dfs1(edge[u][i]);
    num[u] += num[edge[u][i]];
  }
  if (dist[u] % 2 == 0) {
    int temp = 1000000;
    for (int i = 0; i < edge[u].size(); i++) {
      temp = min(temp, num[edge[u][i]] - dp[edge[u][i]]);
    }
    dp[u] = num[u] - temp;
  } else {
    int temp = 0;
    for (int i = 0; i < edge[u].size(); i++) {
      temp += dp[edge[u][i]] - 1;
    }
    dp[u] = temp + 1;
  }
}
void dfs2(int u) {
  if (edge[u].size() == 0) {
    dp[u] = 1;
    return;
  }
  for (int i = 0; i < edge[u].size(); i++) {
    dfs2(edge[u][i]);
  }
  if (dist[u] % 2 == 1) {
    int temp = 1000000;
    for (int i = 0; i < edge[u].size(); i++) temp = min(temp, dp[edge[u][i]]);
    dp[u] = temp;
  } else {
    int temp = 0;
    for (int i = 0; i < edge[u].size(); i++) {
      temp += dp[edge[u][i]];
    }
    dp[u] = temp;
  }
}
int main() {
  int n, u, v;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) edge[i].clear();
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    edge[u].push_back(v);
  }
  dist[1] = 0;
  dfs1(1);
  printf("%d ", dp[1]);
  dfs2(1);
  printf("%d\n", dp[1]);
  return 0;
}
