#include <bits/stdc++.h>
using namespace std;

#define int long long
const double PI = 3.14159265358979323846;
typedef vector<int> vint;
typedef pair<int, int> pint;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int N;
int a[110],b[110];
int br[110];
bool used[110];
vint G[110];

int dfs(int x,int cc){
  used[x]=true;
  int cb=0,ret=cc;
  for(int i=0;i<G[x].size();i++){
    if(used[G[x][i]])continue;
    cb++;
    ret=max(ret,dfs(G[x][i],cc+1));
  }
  br[cc]=max(br[cc],cb);
  return ret;
}

signed main() {
  cin >> N;
  for(int i=0;i<N-1;i++){
    cin>>a[i]>>b[i];
    a[i]--,b[i]--;
    G[a[i]].push_back(b[i]);
    G[b[i]].push_back(a[i]);
  }
  int color=LLONG_MAX,leaf=LLONG_MAX;
  for(int i=0;i<N;i++){
    fill(br,br+N,1);
    fill(used,used+N,false);
    int cc=dfs(i,1),cl=1;
    for(int k=1;k<N;k++)cl*=br[k];
    if(cc<color||cc==color&&cl<leaf)color=cc,leaf=cl;
  }
  for(int i=0;i<N-1;i++){
    fill(br,br+N,1);
    fill(used,used+N,false);
    used[a[i]]=true;
    int cc=dfs(b[i],1),cl=2;
    used[a[i]]=false;
    cc=max(cc,dfs(a[i],1));
    for(int k=1;k<N;k++)cl*=br[k];
    if(cc<color||cc==color&&cl<leaf)color=cc,leaf=cl;
  }
  cout<<color<<" "<<leaf<<endl;
}