#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:128777216")
using namespace std;
const long long LINF = 1000000000000000000LL;
const int INF = 1000000000;
const long double eps = 1e-9;
const long double PI = 3.1415926535897932384626433832795l;
void prepare(string s) {
  if (s.length() != 0) {
    freopen((s + ".in").c_str(), "r", stdin);
    freopen((s + ".out").c_str(), "w", stdout);
  }
}
const int NMAX = 200500;
int n;
vector<int> g[NMAX];
void read() {
  scanf("%d", &n);
  for (int i = 0; i < (int)(n - 1); i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    g[a].push_back(b);
  }
}
pair<int, int> gmax(int v, int h) {
  if ((int)((g[v]).size()) == 0) return make_pair(1, 1);
  if (h == 0) {
    vector<pair<int, int> > t;
    for (int i = 0; i < (int)((int)((g[v]).size())); i++) {
      int u = g[v][i];
      pair<int, int> c = gmax(u, h ^ 1);
      t.push_back(c);
    }
    int f = 0;
    int sum = 0;
    for (int i = 0; i < (int)((int)((t).size())); i++) sum += t[i].second;
    for (int i = 0; i < (int)((int)((t).size())); i++) {
      f = max(f, sum - t[i].second + t[i].first);
    }
    return make_pair(f, sum);
  } else {
    pair<int, int> res = make_pair(0, 0);
    int f = 0;
    for (int i = 0; i < (int)((int)((g[v]).size())); i++) {
      int u = g[v][i];
      pair<int, int> c = gmax(u, h ^ 1);
      res.second += c.second;
      f += c.first - 1;
    }
    res.first = f + 1;
    return res;
  }
}
pair<int, int> gmin(int v, int h) {
  if ((int)((g[v]).size()) == 0) return make_pair(1, 1);
  if (h == 0) {
    pair<int, int> res = make_pair(0, 0);
    for (int i = 0; i < (int)((int)((g[v]).size())); i++) {
      int u = g[v][i];
      pair<int, int> c = gmin(u, h ^ 1);
      res.first += c.first;
      res.second += c.second;
    }
    return res;
  } else {
    pair<int, int> res = make_pair(INF, 0);
    for (int i = 0; i < (int)((int)((g[v]).size())); i++) {
      int u = g[v][i];
      pair<int, int> c = gmin(u, h ^ 1);
      res.second += c.second;
      res.first = min(res.first, c.first);
    }
    return res;
  }
}
void solve() {
  int mx = gmax(1, 0).first;
  int mn = gmin(1, 0).first;
  printf("%d %d\n", mx, mn);
}
int main() {
  prepare("");
  read();
  solve();
  return 0;
}
