#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long M = 1e9 + 7;
const long long inf = 1e18 + 5;
vector<int> g[N];
int level[N];
void dfs(int node, int par) {
  for (int it : g[node]) {
    if (it != par) {
      level[it] = level[node] + 1;
      dfs(it, node);
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x;
    scanf("%d", &x);
    int y;
    scanf("%d", &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  int root = -1;
  for (int i = 1; i <= n; i++) {
    if ((int)g[i].size() == 1) {
      root = i;
      break;
    }
  }
  level[root] = 0;
  dfs(root, -1);
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    if ((int)g[i].size() == 1 and level[i] & 1) {
      flag = 1;
      break;
    }
  }
  int ansmin, ansmax;
  if (flag)
    ansmin = 3;
  else
    ansmin = 1;
  ansmax = n - 1;
  int vis[N] = {0};
  for (int i = 1; i <= n; i++) {
    if ((int)g[i].size() == 1) {
      if (!vis[g[i][0]])
        vis[g[i][0]] = 1;
      else
        ansmax--;
    }
  }
  printf("%d %d\n", ansmin, ansmax);
}
