#include <bits/stdc++.h>
using namespace std;
template <class Ch, class Tr, class Container>
basic_ostream<Ch, Tr>& operator<<(basic_ostream<Ch, Tr>& os,
                                  const Container& x) {
  os << "{ ";
  bool f = 1;
  for (auto& y : x) {
    if (!f)
      os << " , ";
    else
      f = 0;
    os << y;
  }
  return os << "}";
}
template <class X, class Y>
ostream& operator<<(ostream& os, const pair<X, Y>& p) {
  return os << "[" << p.first << ", " << p.second << "]";
}
const int N = 1e5 + 5;
vector<int> adj[N];
bool odd[N], even[N];
bool dfs(int node, int par, int dep) {
  bool l = 1;
  for (int child : adj[node]) {
    if (child == par) continue;
    l = 0;
    if (dfs(child, node, dep + 1)) return 1;
    odd[node] |= odd[child];
    even[node] |= even[child];
  }
  if (l) {
    odd[node] = dep & 1;
    even[node] = !odd[node];
  }
  return odd[node] && even[node];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  int mx = n - 1, root = -1;
  vector<int> cnt(n + 1);
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() == 1) {
      cnt[adj[i].back()]++;
      mx -= cnt[adj[i].back()] > 1;
    } else
      root = i;
  }
  cout << (dfs(root, root, 0) ? 3 : 1) << ' ' << mx;
}
