#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &item) {
  out << '(' << item.first << ", " << item.second << ')';
  return out;
}
template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  for (const auto &item : v) out << item << ' ';
  return out;
}
using namespace std;
int n;
vector<int> G[100010];
int vis[100010], f[100010];
int odd, even;
void dfs(int node, int depth = 0) {
  vis[node] = 1;
  bool leaf = true;
  for (auto next : G[node]) {
    if (!vis[next]) {
      leaf = false;
      dfs(next, depth + 1);
    }
  }
  if (leaf) {
    if (depth % 2)
      odd++;
    else
      even++;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  int root = -1;
  int leafs = 0;
  int parOfLeafs = 0;
  for (int i = 1; i <= n; i++) {
    if (G[i].size() > 1) root = i;
    if (G[i].size() == 1) {
      leafs++;
      if (!f[G[i][0]]) f[G[i][0]] = 1, parOfLeafs++;
    }
  }
  dfs(root);
  if (odd != 0 && even != 0)
    cout << 3 << ' ';
  else
    cout << 1 << ' ';
  cout << (n - 1) - leafs + parOfLeafs;
  return 0;
}
