#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
void pre() {}
void solve() {}
vector<int> g[100009];
int di[100009], d[100009];
int a = 0;
void dfs(int u, int p) {
  int c = 0;
  for (auto &v : g[u])
    if (v != p) di[v] = di[u] + 1, dfs(v, u);
  for (auto &v : g[u])
    if (v != p && d[v] == 1) c++;
  if (p != -1)
    a += (int)(g[u]).size() - 1 - max(c - 1, 0);
  else
    a += (int)(g[u]).size() - max(c - 1, 0);
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  pre();
  int n;
  cin >> n;
  for (int i = 0; i < (n - 1); ++i) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    d[u]++, d[v]++;
    g[u].push_back(v), g[v].push_back(u);
  }
  for (int i = 0; i < (n); ++i)
    if (d[i] != 1) {
      di[i] = 0;
      dfs(i, -1);
      break;
    }
  int o = 0, e = 0;
  for (int i = 0; i < (n); ++i)
    if (d[i] == 1) {
      if (di[i] % 2)
        o++;
      else
        e++;
    }
  if (o && e)
    cout << "3 " << a;
  else
    cout << "1 " << a;
  return 0;
}
