#include <bits/stdc++.h>
using namespace std;
int a[1005],N;
double dp[305][305][305];
double dfs(int x,int y,int z)
{
	if (x==0&&y==0&&z==0) return 0;
	if (dp[x][y][z]>=0) return dp[x][y][z];
	int Sum=x+y+z;
	double ans=1.0*N/Sum;
	if (x) ans+=1.0*dfs(x-1,y,z)*x/Sum;
	if (y) ans+=1.0*dfs(x+1,y-1,z)*y/Sum;
	if (z) ans+=1.0*dfs(x,y+1,z-1)*z/Sum;
	dp[x][y][z]=ans;
	return dp[x][y][z];
}
int main()
{
	scanf("%d",&N);
	memset(dp,-1,sizeof(dp));
	for (int i=1;i<=N;i++)
	  {
	  	int ss;
	  	scanf("%d",&ss);
	  	a[ss]++;
	  }
	printf("%.10lf",dfs(a[1],a[2],a[3]));
}