#include <iostream>
#include <stdio.h>
using namespace std;

int N,A[310];
double dp[310][310][310];

double rec(int i,int j,int k){
	if(dp[i][j][k]!=-1) return dp[i][j][k];
	double n = i+j+k;
	dp[i][j][k] = 1.0*N/(i+j+k);
	if(i!=0) dp[i][j][k] += rec(i-1,j,k)*i/n;
	if(j!=0) dp[i][j][k] += rec(i+1,j-1,k)*j/n;
	if(k!=0) dp[i][j][k] += rec(i,j+1,k-1)*k/n;
	return dp[i][j][k];
}

int main(){
	cin >> N;
	int cnt[4] = {0};
	for(int i=1;i<=N;i++){
		cin >> A[i];
		cnt[A[i]]++;
	}
	for(int i=0;i<=N;i++){
		for(int j=0;j<=N;j++){
			for(int k=0;k<=N;k++){
				dp[i][j][k] = -1;
			}
		}
	}
	dp[0][0][0] = 0;
	printf("%.10f\n",rec(cnt[1],cnt[2],cnt[3]));
}