#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
ld dp[302][302][302];
int main()
{
	int n,x;
	cin>>n;
	int one=0, two=0,three=0;
	for(int i=0;i<n;i++)
	{
		cin>>x;
		if(x==1)one++;
		if(x==2)two++;
		if(x==3)three++;
		
	}
	//cout<<one<<" "<<two<<" "<<three<<"\n";
	
	
	
	for(int k=0;k<=n;k++)
	for(int j=0;j<=n;j++)
	for(int i=0;i<=n;i++)
	{	
		
		if((i+j+k)==0){dp[i][j][k]=0;continue;}
		
		int sum=i+j+k;
		dp[i][j][k]+=((double)n/sum);
		if(i-1>=0)dp[i][j][k]+=dp[i-1][j][k]*i /sum;
		if(j-1>=0)dp[i][j][k]+=dp[i+1][j-1][k]*j /sum;
		if(k-1>=0)dp[i][j][k]+=dp[i][j+1][k-1]*k /sum;
		
	}
	cout<<fixed<<setprecision(10)<<dp[one][two][three];
	//cout<<"hh";
	
	
}