#include <bits/stdc++.h>
using namespace std;
const int N = 300001;
vector<int> g[N];
int d[N];
void dfs(int u, int f) {
  d[u] = d[f] + 1;
  for (int v : g[u])
    if (v != f) dfs(v, u);
}
int main(void) {
  int n;
  scanf("%d", &n);
  set<int> s;
  for (int i = 1; i <= n - 1; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  vector<int> l;
  for (int i = 1; i <= n; ++i)
    if (g[i].size() == 1) l.push_back(i);
  for (int i : l) s.insert(g[i][0]);
  bool o = false;
  dfs(1, 0);
  int c = l.size();
  for (int i = 1; i != c; ++i)
    if ((d[l[0]] + d[l[i]]) % 2) o = true;
  printf("%d %d\n", o ? 3 : 1, n - 1 - (c - (int)s.size()));
  return 0;
}
