#include <bits/stdc++.h>
using namespace std;
int dp1[201000], dp2[201000], siz[201000];
vector<int> g[201000];
void dfs(int u, int fa) {
  siz[u] = 0;
  if ((g[u].size() == 1 && g[u][0] == fa) || g[u].size() == 0) {
    siz[u] = 1;
    dp1[u] = dp2[u] = 1;
    return;
  }
  dp1[u] = 0x3f3f3f3f;
  dp2[u] = 0;
  for (int i = 0; i < (int)g[u].size(); i++) {
    int v = g[u][i];
    if (v == fa) continue;
    dfs(v, u);
    siz[u] += siz[v];
    dp1[u] = min(dp1[u], siz[v] - dp2[v] + 1);
    dp2[u] += (siz[v] - dp1[v]);
  }
  dp2[u]++;
}
int main() {
  int n, u, v;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) g[i].clear();
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, -1);
  cout << siz[1] - dp1[1] + 1 << " " << siz[1] - dp2[1] + 1 << endl;
  return 0;
}
