#include <bits/stdc++.h>
using namespace std;
int o, e;
vector<int> adj[1000005];
bool visited[1000005];
int leaf[1000005];
void dfs(int vertex, int dist) {
  visited[vertex] = true;
  int i;
  if ((long long int)(adj[vertex].size()) == 1) {
    if (dist & 1)
      o++;
    else
      e++;
  }
  for (i = 0; i < (long long int)(adj[vertex].size()); i++) {
    if (visited[adj[vertex][i]] == false) dfs(adj[vertex][i], dist + 1);
  }
}
void solve() {
  int n, i, u, v;
  cin >> n;
  for (i = 1; i < n; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (i = 1; i < n + 1; i++)
    if ((long long int)(adj[i].size()) == 1) leaf[adj[i][0]]++;
  for (i = 1; i < n + 1; i++)
    if ((long long int)(adj[i].size()) == 1) break;
  dfs(i, 0);
  int mn, mx = n - 1;
  if (o)
    mn = 3;
  else
    mn = 1;
  for (i = 1; i < n + 1; i++) mx -= max(0, leaf[i] - 1);
  cout << mn << " " << mx << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
