#include <bits/stdc++.h>
using namespace std;
const int MAXN = 222222;
int n, x, y;
int f[MAXN], g[MAXN], size[MAXN];
vector<int> v[MAXN];
void Dfs1(int k, int fa, int w) {
  bool ok = 0;
  for (vector<int>::iterator it = v[k].begin(); it != v[k].end(); ++it)
    if (*it != fa) {
      Dfs1(*it, k, w ^ 1);
      size[k] += size[*it];
      ok = 1;
    }
  if (!ok) {
    f[k] = 1;
    size[k] = 1;
    return;
  }
  f[k] = 1;
  if (w == 1) {
    for (vector<int>::iterator it = v[k].begin(); it != v[k].end(); ++it)
      if (*it != fa)
        f[k] = (((f[k]) > (size[k] - (size[*it] - f[*it])))
                    ? (f[k])
                    : (size[k] - (size[*it] - f[*it])));
  } else
    for (vector<int>::iterator it = v[k].begin(); it != v[k].end(); ++it)
      if (*it != fa) f[k] += f[*it] - 1;
}
void Dfs2(int k, int fa, int w) {
  bool ok = 0;
  for (vector<int>::iterator it = v[k].begin(); it != v[k].end(); ++it)
    if (*it != fa) {
      Dfs2(*it, k, w ^ 1);
      ok = 1;
    }
  if (!ok) {
    g[k] = 1;
    return;
  }
  g[k] = size[k];
  if (w == 1) {
    for (vector<int>::iterator it = v[k].begin(); it != v[k].end(); ++it)
      if (*it != fa) g[k] -= size[*it] - g[*it];
  } else
    for (vector<int>::iterator it = v[k].begin(); it != v[k].end(); ++it)
      if (*it != fa) g[k] = (((g[k]) < (g[*it])) ? (g[k]) : (g[*it]));
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; ++i) {
    scanf("%d%d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  Dfs1(1, 0, 1);
  Dfs2(1, 0, 1);
  printf("%d %d\n", f[1], g[1]);
  return 0;
}
