#include <bits/stdc++.h>
using namespace std;
void domod(int &a, long long b) { a = (a + b) % 1000000007; }
void mulmod(int &a, long long b) { a = (a * b) % 1000000007; }
int getint() {
  int a;
  scanf("%d", &a);
  return a;
}
long long getll() {
  long long a;
  scanf("%I64d", &a);
  return a;
}
class graphal {
 public:
  int n, m = 0;
  vector<int> *ed;
  graphal(const int &n) : n(n) { ed = new vector<int>[n]; }
  ~graphal() { delete[] ed; }
  void add(int a, int b) {
    ed[a].push_back(b);
    ed[b].push_back(a);
  }
  void load(int m) {
    for (int i = 0; i < m; i++) {
      add(getint() - 1, getint() - 1);
    }
  }
  pair<int, int> dfs(int ix = 0, int par = -1, int d = 0) {
    pair<int, int> res, ret;
    if (d & 1)
      ret = {n + 1, 0};
    else
      ret = {0, n + 1};
    bool leaf = true;
    for (auto i : ed[ix])
      if (i != par) {
        leaf = false;
        res = dfs(i, ix, d + 1);
        if (d & 1)
          ret.first = min(ret.first, res.first), ret.second += res.second;
        else
          ret.first += res.first, ret.second = min(ret.second, res.second);
      }
    if (leaf) {
      m++;
      ret = {1, 1};
    }
    return ret;
  }
};
int main() {
  int n = getint();
  graphal g(n);
  g.load(n - 1);
  pair<int, int> res = g.dfs();
  cout << g.m - res.second + 1 << " " << res.first << endl;
  return 0;
}
