#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, inf = 0x3f3f3f3f;
int n, Root;
int deg[maxn], dep[maxn];
vector<int> G[maxn];
vector<int> tag;
int sum = 0;
bool leaf[maxn];
inline void add(int x, int y) {
  G[x].push_back(y);
  G[y].push_back(x);
  ++deg[x], ++deg[y];
}
void dfs(int node, int fa) {
  dep[node] = dep[fa] + 1;
  int cnt = 0;
  for (int i = (0); i <= (int)(G[node].size() - 1); ++i) {
    int u = G[node][i];
    if (u == fa) continue;
    dfs(u, node);
    if (leaf[u]) ++cnt;
  }
  if (cnt > 0) sum += cnt - 1;
}
int main() {
  int x, y;
  scanf("%d", &n);
  for (int i = (1); i <= (int)(n - 1); ++i) scanf("%d%d", &x, &y), add(x, y);
  for (int i = (1); i <= (int)(n); ++i) {
    if (deg[i] == 1)
      tag.push_back(i), leaf[i] = 1;
    else if (!Root)
      Root = i;
  }
  dep[0] = -1;
  dfs(Root, 0);
  int odd = 0, even = 0;
  for (int i = (0); i <= (int)(tag.size() - 1); ++i) {
    int u = tag[i];
    if (dep[u] & 1)
      ++odd;
    else
      ++even;
  }
  int Min;
  if (odd > 0 && even > 0)
    Min = 3;
  else
    Min = 1;
  printf("%d %d\n", Min, n - 1 - sum);
  return 0;
}
