#include <iostream>
#include <vector>
#include <deque>

using namespace std;

const int maxv = 105;
vector<int> adj [maxv];

typedef long long llong;

int max_deg [maxv];
void calc_max_deg (int vertex, int parent, int lvl) {
  if (parent == 0) {
    max_deg[lvl] = max(max_deg[lvl], (int) adj[vertex].size());
  } else {
    max_deg[lvl] = max(max_deg[lvl], (int) adj[vertex].size() - 1);
  }

  for (int nxt : adj[vertex]) {
    if (nxt != parent) {
      calc_max_deg(nxt, vertex, lvl + 1);
    }
  }
}

pair<int, llong> attempt (int root) {
  for (int i = 0; i < maxv; i++) {
    max_deg[i] = 0;
  }

  calc_max_deg(root, 0, 0);

  pair<int, llong> ans = make_pair(1, 1LL);
  for (int i = 0; i < maxv; i++) {
    if (max_deg[i] != 0) {
      ans.first++;
      ans.second *= max_deg[i];
    }
  }

  return ans;
}

pair<int, llong> attempt (int root, int boot) {
  for (int i = 0; i < maxv; i++) {
    max_deg[i] = 0;
  }

  calc_max_deg(root, boot, 0);
  calc_max_deg(boot, root, 0);

  pair<int, llong> ans = make_pair(1, 2LL);
  for (int i = 0; i < maxv; i++) {
    if (max_deg[i] != 0) {
      ans.first++;
      ans.second *= max_deg[i];
    }
  }

  return ans;
}

int main () {
  int vertexc;
  cin >> vertexc;

  for (int i = 0; i < vertexc - 1; i++) {
    int u, v;
    cin >> u >> v;

    adj[u].push_back(v);
    adj[v].push_back(u);
  }

  pair<int, llong> ans = make_pair(maxv, -1);
  for (int i = 1; i <= vertexc; i++) {
    ans = min(ans, attempt(i));
    for (int u : adj[i]) {
      ans = min(ans, attempt(i, u));
    }
  }

  cout << ans.first << " " << ans.second << endl;
}
