#include <bits/stdc++.h>
using namespace std;
vector<int> readVI(int n) {
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  return a;
}
vector<vector<int> > readVVI(int n, int m) {
  vector<vector<int> > a(n, vector<int>(m));
  for (int i = 0; i < n; i++) a[i] = readVI(m);
  return a;
}
vector<long long> readVLL(long long n) {
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  return a;
}
vector<vector<long long> > readVVLL(long long n, long long m) {
  vector<vector<long long> > a(n, vector<long long>(m));
  for (int i = 0; i < n; i++) a[i] = readVLL(m);
  return a;
}
const int MOD = int(1e9) + 7;
const int INF = INT_MAX;
const long long INFF = INT64_MAX;
const double EPS = 1e-9;
const double PI = acos(-1.0);
const int moveX[] = {-1, 0, 1, 0};
const int moveY[] = {0, 1, 0, -1};
int maxLen(vector<vector<int> >& paths) {
  int n = paths.size();
  pair<int, int> ans = make_pair(0, 0);
  queue<pair<int, int> > bfs;
  bfs.push(make_pair(0, 0));
  vector<bool> seen(n, 0);
  while (!bfs.empty()) {
    pair<int, int> cur = bfs.front();
    bfs.pop();
    if (seen[cur.first]) continue;
    seen[cur.first] = 1;
    if (ans.second < cur.second) ans = cur;
    for (auto el : paths[cur.first]) {
      bfs.push(make_pair(el, cur.second + 1));
    }
  }
  return ans.first;
}
int find(int st, vector<vector<int> >& paths) {
  int n = paths.size();
  int ans = 0;
  queue<pair<int, int> > bfs;
  bfs.push(make_pair(st, 0));
  vector<bool> seen1(n, 0);
  while (!bfs.empty()) {
    pair<int, int> cur = bfs.front();
    bfs.pop();
    if (seen1[cur.first]) continue;
    seen1[cur.first] = 1;
    ans = max(ans, cur.second);
    for (auto el : paths[cur.first]) {
      bfs.push(make_pair(el, cur.second + 1));
    }
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, a, b;
  cin >> n;
  vector<vector<int> > paths(n);
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    a--, b--;
    paths[a].push_back(b);
    paths[b].push_back(a);
  }
  if (n == 3) {
    cout << 1 << ' ' << 1 << "\n";
    return 0;
  }
  set<int> pars;
  vector<int> leaves;
  for (int i = 0; i < n; i++)
    if (paths[i].size() == 1) {
      leaves.push_back(i);
      pars.insert(paths[i][0]);
    }
  int st = maxLen(paths), len = n - 1;
  for (auto el : pars) {
    bool gg = 0;
    if (paths[el].size() == 2) continue;
    for (auto el1 : paths[el]) {
      if (paths[el1].size() == 1) {
        if (gg) len--;
        gg = 1;
      }
    }
  }
  queue<pair<int, int> > bfs;
  bfs.push(make_pair(st, 0));
  vector<int> seen(n, 0);
  while (!bfs.empty()) {
    pair<int, int> cur = bfs.front();
    bfs.pop();
    if (seen[cur.first]) continue;
    seen[cur.first] = cur.second;
    for (auto el : paths[cur.first]) bfs.push(make_pair(el, cur.second + 1));
  }
  int ans1 = 1;
  for (int i = 0; i < leaves.size(); i++) {
    if (seen[leaves[i]] & 1) {
      ans1 = 3;
      break;
    }
  }
  cout << ans1 << ' ' << len << '\n';
  return 0;
}
