#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
vector<int> edges[maxn];
int col[maxn], leaf[maxn], ans = 0;
set<int> ms;
void dfs(int x, int p) {
  col[x] = col[p] ^ 1;
  if (edges[x].size() == 1) {
    leaf[x] = 1;
    ms.insert(col[x]);
  }
  int cnt = 0, cnt1 = 0;
  for (auto i : edges[x]) {
    if (i == p) continue;
    dfs(i, x);
    if (leaf[i] == 0) {
      cnt1++;
    } else {
      cnt++;
    }
  }
  ans += cnt1;
  ans += min(1, cnt);
}
int main(int argc, char const *argv[]) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n - 1; ++i) {
    int x, y;
    scanf("%d %d", &x, &y);
    edges[x].push_back(y);
    edges[y].push_back(x);
  }
  int root = 1;
  while (edges[root].size() == 1) ++root;
  dfs(root, root);
  if (ms.size() == 1) {
    printf("1 %d\n", ans);
  } else {
    printf("3 %d\n", ans);
  }
  return 0;
}
