#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int SIZE = 3e5 + 5;
const long long INF = 1LL << 55;
const double eps = 1e-10;
vector<int> adj[200009];
int cc[200009];
int p[200009];
int dp1[200009];
int dp2[200009];
void ftree(int x, int par) {
  p[x] = par;
  cc[x] = 0;
  for (int i : adj[x]) {
    if (i == par) continue;
    ftree(i, x);
    cc[x] += cc[i];
  }
  if (cc[x] == 0) cc[x] = 1;
}
void maxp2(int x);
void maxp1(int x) {
  dp1[x] = 1;
  for (int i : adj[x]) {
    if (i == p[x]) continue;
    maxp2(i);
    dp1[x] = max(dp1[x], cc[x] - cc[i] + dp1[i]);
  }
}
void maxp2(int x) {
  dp1[x] = 1;
  for (int i : adj[x]) {
    if (i == p[x]) continue;
    maxp1(i);
    dp1[x] += dp1[i] - 1;
  }
}
int main() {
  int(n);
  scanf("%d", &n);
  for (int i = 0; i < (n - 1); ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  ftree(0, -1);
  maxp1(0);
  printf("%d ", dp1[0]);
  maxp2(0);
  printf("%d", cc[0] - dp1[0] + 1);
}
