#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 11;
vector<int> edge[maxn];
int n;
bool ok[maxn];
pair<int, int> dfs1(int x, int dep) {
  pair<int, int> ans = {0, 0};
  if (dep == 1) ans = {0, -1000000000};
  if (edge[x].size() == 0) return {1, 1};
  for (auto son : edge[x]) {
    pair<int, int> b = dfs1(son, dep ^ 1);
    ans.first += b.first;
    if (dep == 1) {
      ans.second = max(ans.second, b.second - b.first);
    } else {
      ans.second += b.second - 1;
    }
  }
  if (dep == 1)
    ans.second = ans.first + ans.second;
  else
    ans.second++;
  return ans;
}
pair<int, int> dfs2(int x, int dep) {
  pair<int, int> ans = {0, 0};
  if (edge[x].size() == 0) return {1, 1};
  if (dep == 0) ans = {0, 1000000000};
  for (auto son : edge[x]) {
    pair<int, int> b = dfs2(son, dep ^ 1);
    ans.first += b.first;
    if (dep == 1) {
      ans.second = ans.second + b.first - b.second;
    } else {
      ans.second = min(ans.second, b.second);
    }
  }
  if (dep == 1) ans.second = ans.first - ans.second;
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    edge[u].push_back(v);
    ok[v] = 1;
  }
  int rt = 0;
  for (int i = 1; i <= n; i++)
    if (!ok[i]) rt = i;
  int ans1 = dfs1(rt, 1).second;
  int ans2 = dfs2(rt, 1).second;
  cout << ans1 << ' ' << ans2 << endl;
  return 0;
}
