#include <iostream>
#include <vector>
#include <algorithm>
#define int long long
#define rep(i, n) for(i = 0; i < n; i++)
using namespace std;

int n;
int a[100], b[100];
vector<int> et[100];

int maxCount[100];
int maxDepth;

void dfs(int p, int v, int dep) {
	int i;
	
	maxDepth = max(maxDepth, dep);
	
	int child_cnt = 0;
	rep(i, et[v].size()) {
		int nv = et[v][i];
		if (nv == p) continue;
		dfs(v, nv, dep + 1);
		child_cnt++;
	}
	
	maxCount[dep] = max(maxCount[dep], child_cnt);
}

signed main() {
	int i, j;
	
	cin >> n;
	rep(i, n - 1) {
		cin >> a[i] >> b[i];
		a[i]--; b[i]--;
		et[a[i]].push_back(b[i]);
		et[b[i]].push_back(a[i]);
	}
	
	int ans1 = 114514;
	int ans2;
	rep(i, n) {
		maxDepth = 0;
		rep(j, n) maxCount[j] = 0;
		dfs(-1, i, 0);
		
		int res1 = maxDepth + 1;
		int res2 = 1;
		rep(j, maxDepth) res2 *= maxCount[j];
		
		if (ans1 > res1 || (ans1 == res1 && ans2 > res2)) {
			ans1 = res1;
			ans2 = res2;
		}
	}
	
	rep(i, n - 1) {
		maxDepth = 0;
		rep(j, n) maxCount[j] = 0;
		dfs(b[i], a[i], 0);
		dfs(a[i], b[i], 0);
		
		int res1 = maxDepth + 1;
		int res2 = 1;
		rep(j, maxDepth) res2 *= maxCount[j];
		res2 *= 2;
		
		if (ans1 > res1 || (ans1 == res1 && ans2 > res2)) {
			ans1 = res1;
			ans2 = res2;
		}
	}
	
	cout << ans1 << " " << ans2 << endl;
	return 0;
}