#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <iomanip> 

using ll = long long;
using ull = unsigned long long;
using namespace std;

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i = 0;(i) < ((int)(n));++(i))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

const int INF = 1e9+7;
const ll INFL = 9*1e18;

// const int dx[4] = { 1, 0, -1, 0 };
// const int dy[4] = { 0, 1, 0, -1 };

const int dx[8] = {1, 1, 0,-1,-1,-1, 0, 1};
const int dy[8] = {0, 1, 1, 1, 0,-1,-1,-1};

ll inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;} // 桁数
template<typename T>inline T SUM(vector<T> vec){return accumulate(all(vec),(T)0);} // vectorの中身を全部足す
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);} // 最大公約数
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;} // 最小公倍数
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;} // 累乗
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template<typename T>inline void print(T&& x){cout<<setprecision(32)<<x<<endl;}// 改行付き出力



double dp[330][330][330];
bool flag[330][330][330];
int n;
 
double recurse(int i, int j, int k)
{
    if (abs(dp[i][j][k] + 1) > 1e-9)
        return dp[i][j][k];
    
    double ret = 0;
    ret += (double)n / (double)(i + j + k);
 
    if (i > 0)
        ret += (double)i / (double)(i + j + k) * recurse(i - 1, j, k);
    if (j > 0)
        ret += (double)j / (double)(i + j + k) * recurse(i + 1, j - 1, k);
    if (k > 0)
        ret += (double)k / (double)(i + j + k) * recurse(i, j + 1, k - 1);
    dp[i][j][k] = ret;
 
    return ret;
}
// TODO: write
int main() {
  cin>>n;
  int c[4] = {0};
  rep(i,n){
    int a;cin>>a;
    c[a]++;
  }
  memset(dp, -1, sizeof(dp));
  dp[0][0][0] = 0;
  print(recurse(c[1],c[2],c[3]));
  return 0;
}
#include <iostream>
#include <vector>
#include <string>
#include<algorithm>
#include<stdio.h>
#include<string>
#include<math.h>
#include<set>
using namespace std;

void itsvgg() 
{
    ios::sync_with_stdio(0);cin.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt", "w", stdout);
    #endif
} 

double rolls[301][301][301];


void initialization()
{
		for(int i=0;i<=300;i++)
		for(int j=0;j<=300;j++)
			for(int k=0;k<=300;k++)
				rolls[i][j][k]=0.0;
}	

double prob(int n, int x,int y, int z)
{
	double p1=double(x)/double(n),p2=double(y)/double(n),p3=double(z)/double(n);
	double p0=1-p1-p2-p3;
	double k=1;
	if(x>0)
	{	
		if(rolls[x-1][y][z]==0)
			k+=p1*prob(n,x-1,y,z);
		else
			k+=p1*rolls[x-1][y][z];
	}	
	if(y>0)
	{	
		if(rolls[x+1][y-1][z]==0)
			k+=p2*prob(n,x+1,y-1,z);
		else
			k+=p2*rolls[x+1][y-1][z];
	}	
	if(z>0)
	{	
		if(rolls[x][y+1][z-1]==0)
			k+=p3*prob(n,x,y+1,z-1);
		else
			k+=p3*rolls[x][y+1][z-1];
	}	
	//cout<<x<<" "<<1-p0<<endl;

	if(x!=0 || y!=0 || z!=0)
		rolls[x][y][z]=k/(1-p0);
	else 
		rolls[x][y][z]=0;
	return rolls[x][y][z];	 
	
}

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);	
    itsvgg();
	initialization();
	int n;
	cin>>n;
	int ones=0,twos=0,threes=0;
	for(int i=0;i<n;i++)
	{
		int x;
		cin>>x;
		if(x==1)
		{
			ones++;
		}
		else if (x==2)
			twos++;
		else
			threes++;
	}
	//cout<<ones<<twos<<threes<<endl;
	
	//cout<<expected[0][0][0];			
	//cout<<ones<<twos<<threes<<endl;
	cout.precision(10);
	cout<<prob(n,ones,twos,threes);
}
