#include <bits/stdc++.h>
using namespace std;
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
void dfs(vector<vector<int>> const &adjList, int root, vector<bool> &visited,
         vector<int> &distroot, int height) {
  visited[root] = true;
  bool leaf = true;
  for (int child : adjList[root]) {
    if (visited[child] == false) {
      leaf = false;
      dfs(adjList, child, visited, distroot, height + 1);
    }
  }
  if (leaf) distroot[root] = height;
}
void solve() {
  int n;
  cin >> n;
  vector<vector<int>> adjList;
  adjList.resize(n + 1);
  int i;
  for (i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    adjList[a].push_back(b);
    adjList[b].push_back(a);
  }
  int root;
  for (i = 1; i <= n; i++) {
    if (adjList[i].size() == 1) {
      root = i;
      break;
    }
  }
  vector<int> distroot;
  distroot.resize(n + 1);
  fill(distroot.begin(), distroot.end(), -1);
  distroot[root] = 0;
  vector<bool> visited;
  visited.resize(n + 1);
  fill(visited.begin(), visited.end(), false);
  dfs(adjList, root, visited, distroot, 0);
  vector<bool> lf;
  lf.resize(n + 1);
  fill(lf.begin(), lf.end(), false);
  int parity = 0;
  int leaf = 0;
  for (i = 1; i <= n; i++) {
    if (distroot[i] != -1) {
      leaf++;
      parity += distroot[i] % 2;
      lf[i] = true;
    }
  }
  int mini, maxi;
  if (parity == 0) {
    mini = 1;
  } else
    mini = 3;
  int leafparent;
  set<int> s;
  for (i = 1; i <= n; i++) {
    if (lf[i] == true) {
      if (adjList[i].size() == 1) s.insert(adjList[i][0]);
    }
  }
  leafparent = s.size();
  maxi = n - 1 - leaf + leafparent;
  cout << mini << " " << maxi << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
