#include <bits/stdc++.h>
using namespace std;
int dfs(vector<vector<int>>& adj, vector<bool>& vis, int node) {
  int result = -2;
  for (int i = 0; i < adj[node].size(); i++) {
    if (!vis[adj[node][i]]) {
      vis[adj[node][i]] = true;
      int temp = dfs(adj, vis, adj[node][i]);
      if (temp == -1) {
        result = -1;
        break;
      } else if (temp == 0) {
        if (result == 0) {
          result = -1;
          break;
        } else {
          result = 1;
        }
      } else {
        if (result == 1) {
          result = -1;
          break;
        } else {
          result = 0;
        }
      }
    }
  }
  if (result == -2) {
    result = 0;
  }
  return result;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<vector<int>> adj(n);
  for (int i = 0; i < n - 1; i++) {
    int t1, t2;
    cin >> t1 >> t2;
    adj[t1 - 1].push_back(t2 - 1);
    adj[t2 - 1].push_back(t1 - 1);
  }
  vector<bool> vis(n, false);
  int root = 0;
  while (adj[root].size() == 1) root++;
  vis[root] = true;
  int result = dfs(adj, vis, root);
  if (result == -1) {
    cout << 3 << " ";
  } else {
    cout << 1 << " ";
  }
  int leaves = 0;
  set<int> s;
  for (int i = 0; i < n; i++) {
    if (adj[i].size() == 1) {
      leaves += 1;
      s.insert(adj[i][0]);
    }
  }
  cout << (n - 1) - leaves + s.size() << '\n';
}
