#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
int ans1[200010], ans2[200010], sz[200010];
vector<int> son[200010];
void rec1(int i, bool small) {
  if (son[i].size() == 0) {
    ans1[i] = 1;
    sz[i] = 1;
  } else {
    for (auto x : son[i]) {
      rec1(x, !small);
      sz[i] += sz[x];
    }
    if (small) {
      ans1[i] = 1;
      for (auto x : son[i]) ans1[i] += ans1[x] - 1;
    } else {
      int mi = oo;
      for (auto x : son[i]) mi = min(mi, sz[x] - ans1[x]);
      ans1[i] = sz[i] - mi;
    }
  }
}
void rec2(int i, bool small) {
  if (son[i].size() == 0) {
    ans2[i] = 1;
  } else {
    for (auto x : son[i]) {
      rec2(x, !small);
    }
    if (small) {
      ans2[i] = oo;
      for (auto x : son[i]) ans2[i] = min(ans2[i], ans2[x]);
    } else {
      int sum = 0;
      for (auto x : son[i]) sum += sz[x] - ans2[x];
      ans2[i] = sz[i] - sum;
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    son[u].push_back(v);
  }
  rec1(1, 0);
  rec2(1, 0);
  cout << ans1[1] << " " << ans2[1] << endl;
}
