#include <bits/stdc++.h>
using namespace std;
template <typename _T>
inline void _DBG(const char *s, _T x) {
  cerr << s << " = " << x << "\n";
}
template <typename _T, typename... args>
void _DBG(const char *s, _T x, args... a) {
  while (*s != ',') cerr << *s++;
  cerr << " = " << x << ',';
  _DBG(s + 1, a...);
}
const int N = 1e5 + 7;
vector<int> G[N];
int dist[N];
bool vis[N];
void dfs(int v, int d) {
  vis[v] = true;
  dist[v] = d;
  for (auto &u : G[v]) {
    if (!vis[u]) {
      dfs(u, d + 1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  int root = -1;
  for (int i = 1; i <= n; i++) {
    if ((int)(G[i]).size() == 1) {
      root = i;
      break;
    }
  }
  dfs(root, 0);
  int parity = dist[root] % 2;
  bool good = true;
  for (int i = 2; i <= n; i++) {
    if ((int)(G[i]).size() == 1 && dist[i] % 2 != parity) {
      good = false;
    }
  }
  if (good) {
    cout << 1 << " ";
  } else {
    cout << 3 << " ";
  }
  int edges = n - 1;
  int leaves = 0;
  set<int> leaf_parents;
  for (int i = 1; i <= n; i++) {
    if ((int)(G[i]).size() == 1) {
      leaves++;
    } else {
      for (auto &u : G[i]) {
        if ((int)(G[u]).size() == 1) {
          leaf_parents.insert(i);
        }
      }
    }
  }
  cout << edges - leaves + (int)(leaf_parents).size() << '\n';
  return 0;
}
