#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const long long MOD = (long long)1000000007;
const long long INF2 = (long long)100000000000000000;
using Graph = vector<vector<int>>;
map<int, int> pars;
int deptho = 0;
int depthe = 0;
int n;
void dfs(const Graph &G, int v, int p, int d) {
  if (G[v].size() == 1) {
    pars[p]++;
    if (d % 2 == 0) {
      depthe++;
    } else {
      deptho++;
    }
  }
  for (auto nv : G[v]) {
    if (nv == p) continue;
    dfs(G, nv, v, d + 1);
  }
}
int main() {
  cin >> n;
  Graph G(n);
  int root = -1;
  set<int> s;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    if (root == -1) {
      if (s.count(a)) {
        root = a;
      } else if (s.count(b)) {
        root = b;
      }
    }
    s.insert(a);
    s.insert(b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(G, root, -1, 0);
  int minv = 1;
  if (depthe >= 1 && deptho >= 1) {
    minv = 3;
  }
  int maxv = n - 1;
  for (auto i : pars) {
    maxv -= (i.second - 1);
  }
  cout << minv << " " << maxv << endl;
  return 0;
}
