#include <bits/stdc++.h>
using namespace std;
const int maxN = 101000;
vector<int> g[maxN];
int deg[maxN];
bool alleven = true;
int used[maxN];
pair<bool, bool> dfs(int v) {
  used[v] = 1;
  bool sawodd = false;
  bool saweven = false;
  int oddcnt = 0;
  int evencnt = 0;
  for (int i = 0; i < g[v].size(); ++i) {
    int to = g[v][i];
    if (!used[to]) {
      auto cur = dfs(to);
      if (cur.first) {
        saweven = true;
        ++evencnt;
      }
      if (cur.second) {
        sawodd = true;
        ++oddcnt;
      }
    }
  }
  if (deg[v] == 1) {
    saweven = true;
  }
  return make_pair(sawodd, saweven);
}
void solve() {
  int n;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    --x, --y;
    g[x].push_back(y);
    g[y].push_back(x);
    ++deg[x];
    ++deg[y];
  }
  int idx = -1;
  for (int i = 0; i < n; ++i) {
    if (deg[i] == 1) {
      idx = i;
    }
  }
  auto res = dfs(idx);
  if (res.first) {
    alleven = false;
  }
  int total = n - 1;
  for (int i = 0; i < n; ++i) {
    int cnt = 0;
    for (int j = 0; j < g[i].size(); ++j) {
      if (deg[g[i][j]] == 1) {
        ++cnt;
      }
    }
    if (cnt > 0) {
      total -= (cnt - 1);
    }
  }
  int minres = alleven ? 1 : 3;
  cout << minres << " " << total << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  t = 1;
  for (int tt = 0; tt < t; ++tt) {
    solve();
  }
  return 0;
}
