#include <iostream>
#include <cstdio>
#include <queue>
#define int long long
using namespace std;
const int N = 105;
queue<int> q;
pair<int, int> res;
int n, head[N], tot, dep[N], mx[N], deg[N];
struct node{int to, nex;}a[N << 1];
inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9') {x = (x << 3) + (x << 1) + (ch ^ 48); ch = getchar();}
	return x * f;
}
void add(int x, int y) {a[++ tot].to = y; a[tot].nex = head[x]; head[x] = tot;}
int dfs(int x, int fa)
{
	int rt = 0;
	for(int i = 1; i <= n; i ++) dep[i] = 0;
	q.push(x); dep[x] = 1;
	if(fa) q.push(fa), dep[fa] = 1;
	while(!q.empty())
	{
		int x = q.front(); q.pop(); mx[dep[x]] = max(mx[dep[x]], deg[x]); rt = max(rt, dep[x]);
		for(int i = head[x]; i; i = a[i].nex)
		{
			int y = a[i].to; if(dep[y]) continue;
			dep[y] = dep[x] + 1; q.push(y);
		}
	}
	return rt;
}
void work(int x, int fa)
{
	pair<int, int> rt;
	for(int i = 1; i <= n; i ++) mx[i] = 0;
	int em = dfs(x, fa); rt = make_pair(em, mx[1] - (fa != 0));
	for(int i = 2; i <= n; i ++)
	{
		if(mx[i] == 1) break;
		rt.second *= (mx[i] - 1);
	}
	if(fa) rt.second *= 2; if(rt < res) res = rt;
}
signed main()
{
//	freopen(".in", "r", stdin);
//	freopen(".out", "w", stdout);
	n = read();
	for(int i = 1, x, y; i <= n - 1; i ++) {x = read(); y = read(); add(x, y); add(y, x); deg[x] ++; deg[y] ++;}
	if(n == 2) {printf("%d %d\n", 1, 2); return 0;}
	res.first = N;
	for(int i = 1; i <= n; i ++) 
	{
		work(i, 0);
		for(int j = head[i]; j; j = a[j].nex) work(i, a[j].to);
	}
	printf("%lld %lld\n", res.first, res.second);
	fclose(stdin);
	fclose(stdout);
	return 0;
}
