#include <bits/stdc++.h>
using namespace std;
const int mXn = 2 * 1e5 + 10;
vector<int> ad[mXn];
int dpmx[mXn], dpmn[mXn], t, cnt[mXn];
bool mark[mXn], mark2[mXn];
void lc(int v) {
  mark[v] = true;
  bool b = true;
  for (int i = 0; i < (int)ad[v].size(); i++) {
    int u = ad[v][i];
    if (!mark[u]) {
      lc(u);
      b = false;
      cnt[v] += cnt[u];
    }
  }
  if (b) cnt[v] = 1;
}
void dfs(int v) {
  mark2[v] = true;
  dpmx[v] = 0;
  for (int i = 0; i < (int)ad[v].size(); i++) {
    int u = ad[v][i];
    if (!mark2[u]) {
      dfs(u);
      dpmx[v] = max(dpmx[v], cnt[v] - cnt[u] + dpmn[u]);
      dpmn[v] += dpmx[u];
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    ad[x].push_back(y);
    ad[y].push_back(x);
  }
  lc(0);
  dfs(0);
  for (int i = 0; i < n; i++) {
  }
  cout << dpmx[0] + 1 << " " << cnt[0] - dpmn[0] << endl;
  int ans = cnt[0];
  for (int i = 0; i < (int)ad[0].size(); i++) {
    ans = min(ans, cnt[0] - cnt[ad[0][i]] + dpmn[ad[0][i]]);
  }
  return 0;
}
