#include <bits/stdc++.h>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

using namespace std;

typedef long long ll;

const int MAX_N=100,INF=1e8;

int N;
vector<int> G[MAX_N+1];
int a[MAX_N],b[MAX_N];

int dist[2][MAX_N+1];

void bfs(int v,int u){
	queue<int> q;
	q.push(v);
	fill(dist[u],dist[u]+N,INF);
	dist[u][v]=0;
	while(!q.empty()){
		int v2=q.front();
		q.pop();
		REP(i,(int)G[v2].size()){
			int v3=G[v2][i];
			if (dist[u][v3]==INF){
				dist[u][v3]=dist[u][v2]+1;
				q.push(v3);
			}
		}
	}
}

int main(){
	cin>>N;
	REP(i,N-1){
		int ta,tb;
		cin>>ta>>tb;
		ta--;
		tb--;
		a[i]=ta;
		b[i]=tb;
		G[ta].push_back(tb);
		G[tb].push_back(ta);
	}
	/*
	int diamv1,diamv2,diam;
	bfs(0,0);
	diam=-1;
	REP(i,N){
		if (dist[0][i]>diam){
			diamv1=i;
			diam=dist[0][i];
		}
	}
	bfs(diamv1,0);
	diam=-1;
	REP(i,N){
		if (dist[0][i]>diam){
			diamv2=i;
			diam=dist[0][i];
		}
	}
	bfs(diamv2,1);
	int cen;
	if(diam%2==0){
		REP(i,N){
			if (dist[0][i]==diam/2 && dist[1][i]==diam/2){
				cen=i;
			}
		}
	}else{
//		cout<<diam<<endl<<diamv1<<endl<<diamv2<<endl;
		REP(v,N){
			cout<<v<<endl;
			if (dist[0][v]==diam/2){
				REP(i,(int)G[v].size()){
					if (dist[1][G[v][i]]==diam/2){
						G[N].push_back(v);
						G[N].push_back(G[v][i]);
						int v2=G[v][i];
						G[v].erase(find(G[v].begin(),G[v].end(),G[v][i]));
						G[v2].erase(find(G[v2].begin(),G[v2].end(),v));
						G[v].push_back(N);
						G[v2].push_back(N);
						cen=N;
						goto LABEL;
					}
				}
			}
		}
		LABEL:
		N++;
	}
	*/
	int col=INF;
	ll leaf=INF;
	REP(cen,N){
		bfs(cen,0);
		int diam=-1;
		REP(v,N){
			diam=max(diam,dist[0][v]);
		}
		if (diam+1>col) continue;
		map<int,ll> mp,mp2;
		REP(v,N){
			if (dist[0][v]==diam){
				mp[v]=1;
			}
		}
		REP(i,diam){
			for(auto ite:mp){
				REP(i,(int)G[ite.first].size()){
					if (dist[0][G[ite.first][i]]<dist[0][ite.first]){
						mp2[G[ite.first][i]]+=ite.second;
					}
				}
			}
			REP(v,N){
				if (dist[0][v]==diam-1-i && mp2.find(v)==mp2.end()){
					mp2[v]=1;
				}
			}
			ll mx=-1;
			for(auto ite:mp2){
				mx=max(mx,ite.second);
			}
			for(auto& ite:mp2){
				ite.second=mx;
			}
			mp=mp2;
			mp2.clear();
		}
		if (diam+1<col){
			col=diam+1;
			auto ite=mp.begin();
			leaf=ite->second;
		}else{
			auto ite=mp.begin();
			leaf=min(leaf,ite->second);
		}
	}
	REP(e,N-1){
		int tempa=a[e],tempb=b[e];
		b[e]=N;
		a[N-1]=N;
		b[N-1]=tempb;
		int V=N+1;
		REP(v,V) G[v].clear();
		REP(f,V-1){
			G[a[f]].push_back(b[f]);
			G[b[f]].push_back(a[f]);
		}
		int cen=N;
		bfs(cen,0);
		int diam=-1;
		REP(v,V){
			diam=max(diam,dist[0][v]);
		}
		if (diam<=col){
			map<int,ll> mp,mp2;
			REP(v,V){
				if (dist[0][v]==diam){
					mp[v]=1;
				}
			}
			REP(i,diam){
				for(auto ite:mp){
					REP(i,(int)G[ite.first].size()){
						if (dist[0][G[ite.first][i]]<dist[0][ite.first]){
							mp2[G[ite.first][i]]+=ite.second;
						}
					}
				}
				REP(v,V){
					if (dist[0][v]==diam-1-i && mp2.find(v)==mp2.end()){
						mp2[v]=1;
					}
				}
				ll mx=-1;
				for(auto ite:mp2){
					mx=max(mx,ite.second);
				}
				for(auto& ite:mp2){
					ite.second=mx;
				}
				mp=mp2;
				mp2.clear();
			}
			if (diam<col){
				col=diam;
				auto ite=mp.begin();
				leaf=ite->second;
			}else{
				auto ite=mp.begin();
				leaf=min(leaf,ite->second);
			}
		}
		a[e]=tempa;
		b[e]=tempb;
	}		
	cout<<col<<" "<<leaf<<endl;
	return 0;
}

Measured memory_bytes: 256