#include<bits/stdc++.h>
using namespace std;
double dp[301][301][301];
int n,a,b,c;
void init(){
	cin>>n;
	for(int i=1;i<=n;++i)
	{
		int d;
		cin>>d;
		if(d==1)a++;
		if(d==2)b++;
		if(d==3)c++;
	}
	return ;
}
double dfs(int a,int b,int c)
{
	if(a==0&&b==0&&c==0)return 0;
	if(dp[a][b][c]!=0)return dp[a][b][c];
	double ans=1.0*n/(a+b+c);
	if(a)ans+=(1.0*a/(a+b+c))*dfs(a-1,b,c);
	if(b)ans+=(1.0*b/(a+b+c))*dfs(a+1,b-1,c);
	if(c)ans+=(1.0*c/(a+b+c))*dfs(a,b+1,c-1);
	return dp[a][b][c]=ans;
}
int main()
{
	init();
	dfs(a,b,c);
	printf("%.10lf",dp[a][b][c]);
}