#include <bits/stdc++.h>
using namespace std;

signed main() {
  cin.tie(0); ios::sync_with_stdio(false);
  int n; cin >> n;
  if (n == 2) {
    cout << "1  2" << '\n';
    return 0;
  }
  vector<vector<int>> tree(n);
  for (int i = 0; i < n - 1; i++) {
    int a, b; cin >> a >> b;
    a--; b--;
    tree[a].push_back(b);
    tree[b].push_back(a);
  }
  auto f = [&](int r) {
    queue<int> q;
    vector<int> d(n, -1);
    d[r] = 0;
    q.push(r);
    while (not q.empty()) {
      int v = q.front(); q.pop();
      for (auto i : tree[v]) {
        if (d[i] == -1) {
          d[i] = d[v] + 1;
          q.push(i);
        }
      }
    }
    return *max_element(d.begin(), d.end());
  };
  int rad = 1e9;
  for (int i = 0; i < n; i++) {
    rad = min(rad, f(i));
  }
  vector<int> center;
  for (int i = 0; i < n; i++) {
    if (rad == f(i)) center.push_back(i);
  }
  vector<int> par(n, -1);
  vector<long long> ha(n, 0);
  long long res = numeric_limits<long long>::max();
  if (center.size() == 2) {
    par[center[0]] = center[0]; par[center[1]] = center[1];
    queue<int> q;
    q.push(center[0]); q.push(center[1]);
    while (not q.empty()) {
      int v = q.front(); q.pop();
      for (auto i : tree[v]) {
        if (par[i] == -1) {
          par[i] = v;
          q.push(i);
        }
      }
    }
    vector<int> d(n, -1);
    d[center[0]] = d[center[1]] = 0;
    q.push(center[0]); q.push(center[1]);
    while (not q.empty()) {
      int v = q.front(); q.pop();
      for (auto i : tree[v]) {
        if (d[i] == -1) {
          d[i] = d[v] + 1;
          q.push(i);
        }
      }
    }
    rad =*max_element(d.begin(), d.end());
    vector<vector<int>> db(rad + 1);
    for (int i = 0; i < n; i++) db[d[i]].push_back(i);
    for (int i = rad; i > 0; i--) {
      for (auto v : db[i]) ha[par[v]] += max(1LL, ha[v]);
      long long ma = -1;
      for (auto v : db[i - 1]) ma = max(ma, ha[v]);
      for (auto v : db[i - 1]) ha[v] = ma;
    }
    res = ha[center[0]] * 2;
  } else {
    for (auto adj : tree[center[0]]) {
      fill(par.begin(), par.end(), -1);
      fill(ha.begin(), ha.end(), 0);
      par[center[0]] = center[0]; par[adj] = adj;
      queue<int> q;
      q.push(center[0]); q.push(adj);
      while (not q.empty()) {
        int v = q.front(); q.pop();
        for (auto i : tree[v]) {
          if (par[i] == -1) {
            par[i] = v;
            q.push(i);
          }
        }
      }
      vector<int> d(n, -1);
      d[center[0]] = d[adj] = 0;
      q.push(center[0]); q.push(adj);
      while (not q.empty()) {
        int v = q.front(); q.pop();
        for (auto i : tree[v]) {
          if (d[i] == -1) {
            d[i] = d[v] + 1;
            q.push(i);
          }
        }
      }
      rad =*max_element(d.begin(), d.end());
      vector<vector<int>> db(rad + 1);
      for (int i = 0; i < n; i++) db[d[i]].push_back(i);
      for (int i = rad; i > 0; i--) {
        for (auto v : db[i]) ha[par[v]] += max(1LL, ha[v]);
        long long ma = -1;
        for (auto v : db[i - 1]) ma = max(ma, ha[v]);
        for (auto v : db[i - 1]) ha[v] = ma;
      }
      res = min(res, ha[center[0]] * 2);
    }
    fill(par.begin(), par.end(), -1);
    fill(ha.begin(), ha.end(), 0);
    par[center[0]] = center[0];
    queue<int> q;
    q.push(center[0]);
    while (not q.empty()) {
      int v = q.front(); q.pop();
      for (auto i : tree[v]) {
        if (par[i] == -1) {
          par[i] = v;
          q.push(i);
        }
      }
    }
    vector<int> d(n, -1);
    d[center[0]] = 0;
    q.push(center[0]);
    while (not q.empty()) {
      int v = q.front(); q.pop();
      for (auto i : tree[v]) {
        if (d[i] == -1) {
          d[i] = d[v] + 1;
          q.push(i);
        }
      }
    }
    rad =*max_element(d.begin(), d.end());
    vector<vector<int>> db(rad + 1);
    for (int i = 0; i < n; i++) db[d[i]].push_back(i);
    for (int i = rad; i > 0; i--) {
      for (auto v : db[i]) ha[par[v]] += max(1LL, ha[v]);
      long long ma = -1;
      for (auto v : db[i - 1]) ma = max(ma, ha[v]);
      for (auto v : db[i - 1]) ha[v] = ma;
    }
    for (int i = 0; i < n; i++) cerr << i + 1 << ' ' << ha[i] << '\n';
    res = min(res, ha[center[0]]);
  }
  cout << rad + 1 << ' ' << res << '\n';
  return 0;
}

Measured memory_bytes: 256