#include <bits/stdc++.h>
using namespace std;
int degree[100000 + 1] = {0};
void dfs1(int u, vector<int> edges[], int p, int &maxim, int traced = 0) {
  bool attached_leaf = false;
  for (auto v : edges[u]) {
    if (v != p) {
      if (degree[v] == 1) {
        if (traced > 1) {
          attached_leaf = true;
        }
        continue;
      }
      maxim++;
      traced++;
      dfs1(v, edges, u, maxim, traced);
      traced--;
    }
  }
  if (attached_leaf) {
    ++maxim;
  }
  return;
}
bool dfs2(int start, vector<int> edges[], int p, int count) {
  if (p != -1 && degree[start] == 1) {
    if (count & 1) {
      return true;
    }
    return false;
  }
  bool ans = false;
  for (auto v : edges[start]) {
    if (v != p) {
      ans = ans || dfs2(v, edges, start, count + 1);
    }
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> edges[n + 1];
  for (int i = 1; i <= n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    edges[u].push_back(v);
    edges[v].push_back(u);
    degree[u]++;
    degree[v]++;
  }
  int start = 1;
  for (int i = 1; i <= n; i++) {
    if (degree[i] == 1) {
      start = i;
      break;
    }
  }
  int maxim = 0, minim = 1;
  dfs1(start, edges, -1, maxim, 0);
  bool ans = dfs2(start, edges, -1, 0);
  if (ans) {
    minim = 3;
  }
  cout << minim << " " << maxim << endl;
}
