#include <iostream>
using namespace std;
int n,cnt[4];
bool vis[305][305][305];
double dp[305][305][305];
double solve(int i,int j,int k)
{
	double tot=i+j+k;
	if (i<0 || j<0 || k<0 || !tot)
	return 0;
	if (vis[i][j][k])
	return dp[i][j][k];
	vis[i][j][k]=1;
	return dp[i][j][k]=(n+i*solve(i-1,j,k)+j*solve(i+1,j-1,k)+k*solve(i,j+1,k-1))/tot;
}
int main()
{
	scanf("%d",&n);
	for (int i=0;i<n;i++)
	{
		int a;
		scanf("%d",&a);
		cnt[a]++;
	}
	printf("%.12lf",solve(cnt[1],cnt[2],cnt[3]));
}