#include <bits/stdc++.h>
using namespace std;

int cnt[4];
double dp[333][333][333];
int n , x;

double f(int i , int j , int k)
{
	if(i == 0 && j == 0 && k == 0)return 0.0;
	
	if(dp[i][j][k])return dp[i][j][k];;;
	
	double res = n;
	
	if(i)res += f(i-1 , j , k) * i;
	if(j)res += f(i+1 , j-1 , k) * j;
	if(k)res += f(i , j+1 , k-1) * k;
	
	return dp[i][j][k] = res / (i+j+k);
	
}

int main()
{
	cin >> n;
	
	for(int i = 1; i <= n; i++)
	{
		cin >> x;
		cnt[x]++;
	}
	
	cout << setprecision(10) << fixed << f( cnt[1] , cnt[2] , cnt[3] );
	
}
