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


// type definitions
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< vi > vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef complex<int> ci;
typedef complex<double> cd;
typedef complex<long double> cld;

// macros
#define rep(i, a, b) for(int i=a; i<b; i++)
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
#define all(c) c.begin(), c.end()
#define tr(c, it) for(auto it=(c).begin(); it!=c.end(); it++)
#define pb push_back
#define bitcount __builtin_popcount
#define ispresent(c, x) ((c).find(x) != (c).end())
#define watch(x) cout<< (#x) << " is " << (x) <<"\n";
#define sz(x) ((int)((x).size()))
#define UNIQUE(c) (c).resize(unique(all(c)) - (c).begin())
#define pii2ll(p) ((ll)(p).first<<32 | (p).second)

// template functions
template <typename T>
inline void printV(vector<T>& a) { rep(i, 0, sz(a)) { cout<<a[i]<<" "; } cout<<"\n"; }
template <typename T>
inline void printV(vector<T>& a, int n) { rep(i, 0, n) { cout<<a[i]<<" "; } cout<<"\n"; }
template <typename T>
inline void printVV(vector<vector<T>>& a)
{
	rep(i, 0, sz(a)) {
		printV(a[i]);
	}
	cout<<"\n";
}

template <typename T>
inline void clearVV(vector<vector<T>>& a)
{
	for(auto& x:a) {
		x.clear();
	}
	a.clear();
}
template <typename T>
inline void assignVV(vector<vector<T>> &a, T val)
{
	for(int i=0; i<sz(a); i++) {
		for(int j=0; j<sz(a[i]); j++) {
			a[i][j]=val;
		}
	}
}


// constants
const long double eps = 1e-9;
const int inf = 5e8;
const int modn = 1e9+7;
const int MAX = 301;
typedef long double ld;

ld dp[MAX][MAX][MAX];
int n;

ld solve(int sum1, int sum2, int sum3)
{
	if(sum1<0 or sum2<0 or sum3<0) return 0;
	if(sum1==0 and sum2==0 and sum3==0) return (ld)0;
	ld &memo=dp[sum1][sum2][sum3];
	if(fabs(dp[sum1][sum2][sum3]+1)>eps) return memo;
	if(sum1==0) {
		if(sum2==0) {
			memo=(ld)n/sum3;
			long double tmp=1+solve(sum1, sum2+1, sum3-1)*sum3/n;
			memo*=tmp;
			return memo;
		}
		if(sum3==0) {
			memo=(ld)n/sum2;
			long double tmp=1+solve(sum1+1, sum2-1, sum3)*sum2/n;
			memo*=tmp;
			return memo;
		}
	}
	if(sum2==0) {
		if(sum3==0) {
			memo=(ld)n/sum1;
			long double tmp=1+solve(sum1-1, sum2, sum3)*sum1/n;
			memo*=tmp;
			return memo;
		}
		memo=(ld)n/(sum1+sum3);
		long double tmp=1+solve(sum1-1, sum2, sum3)*sum1/n;
		tmp+=solve(sum1, sum2+1, sum3-1)*sum3/n;
		memo*=tmp;
		return memo;
	}
	if(sum3==0) {
		memo=(ld)n/(sum1+sum2);
		long double tmp=1+solve(sum1-1, sum2, sum3)*sum1/n;
		tmp+=solve(sum1+1, sum2-1, sum3)*sum2/n;
		memo*=tmp;
		return memo;
	}
	memo=(ld)n/(sum1+sum2+sum3);
	long double tmp=1+solve(sum1-1, sum2, sum3)*sum1/n;
	tmp+=solve(sum1+1, sum2-1, sum3)*sum2/n;
	tmp+=solve(sum1, sum2+1, sum3-1)*sum3/n;
	memo*=tmp;
	return memo;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // Your code here
    cout<<fixed<<setprecision(10);
    cin>>n;
    vector<int> a(n);
    
    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;
			}
		}
    }
    int s1=0;
    int s2=0;
    int s3=0;
    for(int i=0; i<n; i++) {
		cin>>a[i];
		if(a[i]==1) {
			s1++;
		}
		if(a[i]==2) {
			s2++;
		}
		if(a[i]==3) {
			s3++;
		}
    }
    
    cout<<solve(s1, s2, s3)<<"\n";
    //~ watch(TIME);
    return 0;
}



Measured memory_bytes: 426496