#include<bits/stdc++.h>

using namespace std;

#define LL long long
#define N 300
#define INF 0x3f3f3f3f3f3f3f3fLL

LL n,tot,dep,ans1,ans2,head[N],x[N],y[N],f[N],g[N],d[N];
struct edge{LL v,nxt;}e[N];

void add(LL x,LL y){e[++tot].v=y; e[tot].nxt=head[x]; head[x]=tot;}

void dfs(LL u,LL fa){
	LL num=0; dep=max(dep,d[u]);
	for (LL i=head[u],v;i;i=e[i].nxt)
		if ((v=e[i].v)!=fa){d[v]=d[u]+1; dfs(v,u); ++num;}
	++f[d[u]]; g[d[u]]=max(g[d[u]],num);
}

int main(){
	scanf("%lld",&n);
	if (n==2){puts("1 2"); return 0;}
	for (LL i=1;i<n;++i){
		scanf("%lld%lld",&x[i],&y[i]);
		add(x[i],y[i]); add(y[i],x[i]);
	}
	ans1=ans2=INF;
	for (LL i=1;i<=n;++i){
		memset(f,0,sizeof f); memset(g,0,sizeof g);
		dep=0; d[i]=1; dfs(i,0);
		if (dep>n/2+2) continue;
		for (LL j=n;j;--j)
			if (g[j]&&g[j+1]) g[j]=g[j]*g[j+1];
		if (dep<ans1){ans1=dep; ans2=g[1];}
		else if (dep==ans1) ans2=min(ans2,g[1]);
	}
	for (LL i=1;i<n;++i){
		memset(f,0,sizeof f); memset(g,0,sizeof g);
		dep=0; d[x[i]]=d[y[i]]=1; dfs(x[i],y[i]); dfs(y[i],x[i]);
		if (dep>n/2+2) continue;
		for (LL j=n;j;--j)
			if (g[j]&&g[j+1]) g[j]=g[j]*g[j+1];
		if (dep<ans1){ans1=dep; ans2=g[1]*2;}
		else if (dep==ans1) ans2=min(ans2,g[1]*2);
	}
	printf("%lld %lld\n",ans1,ans2);
	
	return 0;
}
			