#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
int n, leafNum;
struct Edge {
  int v, next;
} edge[MAXN];
int head[MAXN], edgeNum;
int dp[MAXN][2];
void clearEdge() {
  edgeNum = 0;
  memset(head, -1, sizeof(head));
}
inline void addEdge(int u, int v) {
  edge[edgeNum].v = v;
  edge[edgeNum].next = head[u];
  head[u] = edgeNum++;
}
void dfs(int u) {
  if (head[u] == -1) {
    ++leafNum;
    dp[u][0] = dp[u][1] = 1;
  } else {
    dp[u][0] = 0;
    dp[u][1] = 0x7fffffff;
    for (int i = head[u]; i != -1; i = edge[i].next) {
      int v = edge[i].v;
      dfs(v);
      dp[u][0] += dp[v][1];
      dp[u][1] = min(dp[u][1], dp[v][0]);
    }
  }
}
int main() {
  int u, v;
  while (cin >> n) {
    clearEdge();
    for (int i = 1; i < n; ++i) {
      cin >> u >> v;
      addEdge(u, v);
    }
    leafNum = 0;
    dfs(1);
    cout << leafNum - dp[1][1] + 1 << " " << dp[1][0] << endl;
  }
  return 0;
}
