#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
 
using namespace std;
 
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f3f3f3f3fLL
#define SIZE 200105
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
 
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
ll MOD = 1000000007;
//ll MOD=998244353;
typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
int N;
pair<double,double> dp[305][305][305];
double p[3030];
int main(){
	cin>>N;
	int num=0;
	int cnt[3]={0};
	rep(i,N){
		int x;
		cin>>x;x--;
		num+=x+1;
		cnt[x]++;
	}
	rep(i,N+2)rep(j,N+2)rep(k,N+2)dp[i][j][k]=mp(0.0,0.0);
	dp[cnt[0]][cnt[1]][cnt[2]]=mp(1.0,0.0);
	for(int k=N;k>=0;k--){
		for(int j=N;j>=0;j--){
			for(int i=N;i>=0;i--){
				if(i>0)dp[i-1][j][k].first += dp[i][j][k].first*(double)i/(double)(i+j+k);
				if(j>0)dp[i+1][j-1][k].first += dp[i][j][k].first*(double)j/(double)(i+j+k);
				if(k>0)dp[i][j+1][k-1].first += dp[i][j][k].first*(double)k/(double)(i+j+k);
			}
		}
	}
	for(int k=N;k>=0;k--){
		for(int j=N;j>=0;j--){
			for(int i=N;i>=0;i--){
				double px=0.0,py=0.0,pz=0.0;
				px = dp[i+1][j][k].first*(double)(i+1)/(double)(i+j+k+1);
				if(i>0)py = dp[i-1][j+1][k].first*(double)(j+1)/(double)(i+j+k);
				if(j>0)pz = dp[i][j-1][k+1].first*(double)(k+1)/(double)(i+j+k);
				if(px+py+pz > 0.00000000000001){
					dp[i][j][k].second += px/(px+py+pz) * (dp[i+1][j][k].second + (double)N/(double)(i+j+k+1));
					if(i>0)dp[i][j][k].second += py/(px+py+pz) * (dp[i-1][j+1][k].second + (double)N/(double)(i+j+k) );
					if(j>0)dp[i][j][k].second += pz/(px+py+pz) * (dp[i][j-1][k+1].second + (double)N/(double)(i+j+k));
				}
				
			}
		}
	}
	
	/*rep(i,N+1)rep(j,N+1)rep(k,N+1){
		cout<<i<<j<<k<<" "<<dp[i][j][k].first<<" "<<dp[i][j][k].second<<endl;
	}*/
	
	
	printf("%.9lf\n",dp[0][0][0].second);
}

Measured memory_bytes: 440704