#include <bits/stdc++.h>

using namespace std;

const int N = 105;

int n;
int d[2][N];
pair<int, long long> res;
vector<int> G[N];
vector<int> vec[N];

void dfs(bool t, int u, int p) {
	for (auto v : G[u]) if (v != p) {
		d[t][v] = d[t][u] + 1, dfs(t, v, u);
	}
}

pair<int, long long> solve(int x, int y) {
	d[0][x] = d[1][y] = 1, dfs(0, x, x), dfs(1, y, y);
	int r1 = 0;
	for (int i = 1; i <= n; ++i) vec[i].clear();
	for (int i = 1; i <= n; ++i) {
		int tmp = min(d[0][i], d[1][i]);
		r1 = max(r1, tmp), vec[tmp].push_back(i);
	}
	long long r2 = vec[r1].size(), cur = 1;
	for (int i = r1 - 1; i >= 1; --i) {
		int mx = 0;
		for (auto j : vec[i]) {
			mx = max(mx, (int)G[j].size() - 1);
		}
		for (auto j : vec[i]) {
			r2 += (mx - (G[j].size() - 1)) * cur;
		}
		cur = cur * mx;
	}
	return make_pair(r1, r2);
}

int main() {
	ios::sync_with_stdio(false);
	cin >> n;
	for (int i = 0; i < (n - 1); ++i) {
		int u, v; cin >> u >> v;
		G[u].push_back(v), G[v].push_back(u);
	}
	res = {(int)1e9, (long long)1e18};
	for (int i = 1; i <= n; ++i) {
		res = min(res, solve(i, i));
		for (auto j : G[i]) res = min(res, solve(i, j));
	}
	cout << res.first << ' ' << res.second << '\n';
}