#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const long double PI = 3.14159265358979323846;
const long double gammama = 0.57721566490153286060;
const long double eps = 1e-5;
const int INF = 1000 * 1000 * 1000 + 1;
const long long LINF = (long long)1000 * 1000 * 1000 * 1000 * 1000 * 1000;
const long long mod = 1000 * 1000 * 1000 + 7;
const long long N = 1001;
int n;
vector<vector<int> > g;
vector<int> h;
vector<int> maxPen, minPen;
vector<int> leafs;
vector<int> sz;
vector<int> children;
void dfs0(int pos, int pr = -1) {
  if (pr != -1) h[pos] = h[pr] + 1;
  sz[pos] = 1;
  if ((g[pos].size() == 1) && (pr != -1)) leafs[pos] = 1;
  for (int i = 0; i < g[pos].size(); ++i) {
    int to = g[pos][i];
    if (to == pr) continue;
    ++children[pos];
    dfs0(to, pos);
    leafs[pos] += leafs[to];
    sz[pos] += sz[to];
  }
}
void dfs1(int pos, int pr = -1) {
  if ((h[pos] & 1) == 0) {
    maxPen[pos] = sz[pos] - 1;
  } else {
    maxPen[pos] = max(0, children[pos] - 1);
  }
  for (int i = 0; i < g[pos].size(); ++i) {
    int to = g[pos][i];
    if (to == pr) continue;
    dfs1(to, pos);
    if ((h[pos] & 1) == 0) {
      maxPen[pos] = min(maxPen[pos], maxPen[to]);
    } else {
      maxPen[pos] += maxPen[to];
    }
  }
}
void dfs2(int pos, int pr = -1) {
  if ((h[pos] & 1) == 1) {
    minPen[pos] = sz[pos] - 1;
  } else {
    minPen[pos] = max(0, children[pos] - 1);
  }
  for (int i = 0; i < g[pos].size(); ++i) {
    int to = g[pos][i];
    if (to == pr) continue;
    dfs2(to, pos);
    if ((h[pos] & 1) == 1) {
      minPen[pos] = min(minPen[pos], minPen[to]);
    } else {
      minPen[pos] += minPen[to];
    }
  }
}
void solve() {
  cin >> n;
  g.resize(n);
  h.assign(n, 0);
  maxPen.assign(n, 0);
  minPen.assign(n, 0);
  leafs.assign(n, 0);
  sz.assign(n, 0);
  children.assign(n, 0);
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs0(0);
  dfs1(0);
  dfs2(0);
  if (n == 1) {
    cout << 1 << " " << 1 << endl;
    return;
  }
  cout << leafs[0] - maxPen[0] << " " << minPen[0] + 1 << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  solve();
  return 0;
}
