#include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int>> adj;
vector<int> child, height;
void dfs_child(int u, int p = -1) {
  for (int v : adj[u])
    if (v ^ p) {
      dfs_child(v, u);
      child[u] += child[v] + 1;
    }
}
void dfs_height(int u, int p = -1) {
  if (p >= 0) height[u] = height[p] + 1;
  for (int v : adj[u])
    if (v ^ p) dfs_height(v, u);
}
int dfs_max(int u = 0, int p = -1) {
  int cnt = 0;
  int add = 0;
  for (int v : adj[u])
    if (v ^ p) {
      if (child[v] == 0)
        add = 1;
      else
        cnt++;
      cnt += dfs_max(v, u);
    }
  return cnt + add;
}
int calcMin() {
  set<int> mod;
  for (int i = 0; i < n; i++)
    if (child[i] == 0) mod.insert(height[i] % 2);
  if (mod.size() == 1) return 1;
  return 3;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  cin >> n;
  adj.resize(n);
  child.resize(n, 0);
  height.resize(n, 0);
  for (int i = 0, u, v; i < n - 1; i++) {
    cin >> u >> v, u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  int p = 0;
  for (int u = 0; u < n; u++)
    if (adj[u].size() != 1) {
      p = u;
      break;
    }
  dfs_child(p);
  dfs_height(p);
  cout << calcMin() << " " << dfs_max(p) << endl;
  return 0;
}
