#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
const long long INF = 2e9 + 7;
const long long MOD = 1e9 + 7;
int dp1[N], dp2[N], cnt[N];
vector<int> adj[N];
void dfs(int v, int p, bool turn) {
  bool leaf = 1;
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (u != p) {
      dfs(u, v, 1 - turn);
      leaf = 0;
    }
  }
  if (leaf) {
    cnt[v] = 1;
    dp1[v] = 1;
    dp2[v] = 1;
    return;
  }
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (u != p) {
      cnt[v] += cnt[u];
    }
  }
  if (turn) {
    int mindif = cnt[v];
    for (int i = 0; i < adj[v].size(); i++) {
      int u = adj[v][i];
      if (u != p) {
        mindif = min(mindif, cnt[u] - dp1[u] + 1);
      }
    }
    dp1[v] = cnt[v] - mindif + 1;
    int sum = 0;
    for (int i = 0; i < adj[v].size(); i++) {
      int u = adj[v][i];
      if (u != p) {
        sum += cnt[u] - dp2[u];
      }
    }
    dp2[v] = cnt[v] - sum;
  } else {
    int mindif = cnt[v];
    for (int i = 0; i < adj[v].size(); i++) {
      int u = adj[v][i];
      if (u != p) {
        mindif = min(mindif, dp2[u]);
      }
    }
    dp2[v] = mindif;
    int sum = 0;
    for (int i = 0; i < adj[v].size(); i++) {
      int u = adj[v][i];
      if (u != p) {
        sum += cnt[u] - dp1[u] + 1;
      }
    }
    dp1[v] = cnt[v] - sum + 1;
  }
}
int main() {
  ios ::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[v].push_back(u);
    adj[u].push_back(v);
  }
  dfs(1, 0, 1);
  cout << dp1[1] << " " << dp2[1] << "\n";
  return 0;
}
