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

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define RREP(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define LET(x,a) __typeof(a) x(a)
//#define IFOR(i,it,c) for(__typeof((c).begin())it=(c).begin();it!=(c).end();++it,++i)
#define ALL(c) (c).begin(), (c).end()
#define MP make_pair

#define EXIST(e,s) ((s).find(e)!=(s).end())

#define RESET(a) memset((a),0,sizeof(a))
#define SET(a) memset((a),-1,sizeof(a))
#define PB push_back
#define DEC(it,command) __typeof(command) it=command

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define debug2(x) cerr << #x << " = [";REP(__ind,(x).size()){cerr << (x)[__ind] << ", ";}cerr << "] (L" << __LINE__ << ")" << endl;

typedef long long Int;
typedef unsigned long long uInt;
typedef long double rn;

typedef pair<int,int> pii;

/*
#ifdef MYDEBUG
#include"debug.h"
#include"print.h"
#endif
*/
// }}}

//{{{ io
FILE *file_in=stdin,*file_out=stdout;
#define fin normal_in
#define fout normal_out
//const char fname[]="";
//FILE *fin=fopen(fname,"r"),*fout=fopen(fname,"w");
#ifdef __MINGW32__
#define LLD "%I64d"
#define LLU "%I64u"
#else
#define LLD "%lld"
#define LLU "%llu"
#endif
struct NORMAL_IN{
	bool cnt;
	NORMAL_IN():cnt(true){}
	operator int() const {return cnt;}
#define endl "\n"
	NORMAL_IN& operator>>(int &n){cnt=fscanf(file_in,"%d",&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(unsigned int &n){cnt=fscanf(file_in,"%u",&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(long long &n){cnt=fscanf(file_in,LLD,&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(unsigned long long &n){cnt=fscanf(file_in,LLU,&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(double &n){cnt=fscanf(file_in,"%lf",&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(long double &n){cnt=fscanf(file_in,"%Lf",&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(char *c){cnt=fscanf(file_in,"%s",c)!=EOF;return *this;}
	NORMAL_IN& operator>>(string &s){
		s.clear();
		for(bool r=false;;){
			const char c=getchar();
			if(c==EOF){ cnt=false; break;}
			const int t=isspace(c);
			if(!r and !t)r=true;
			if(r){
				if(!t)s.push_back(c);
				else break;
			}
		}
		return *this;
	}
	template<class T>
		NORMAL_IN& operator>>(vector<T> &v){
			int v_size = v.size();
			REP(i,v_size){
				*this>>v[i];
			}
			return *this;
		}
} normal_in;

struct NORMAL_OUT{
	NORMAL_OUT& operator<<(const int &n){fprintf(file_out,"%d",n);return *this;}
	NORMAL_OUT& operator<<(const unsigned int &n){fprintf(file_out,"%u",n);return *this;}
	NORMAL_OUT& operator<<(const long long &n){fprintf(file_out,LLD,n);return *this;}
	NORMAL_OUT& operator<<(const unsigned long long &n){fprintf(file_out,LLU,n);return *this;}
	NORMAL_OUT& operator<<(const double &n){fprintf(file_out,"%lf",n);return *this;}
	NORMAL_OUT& operator<<(const long double &n){fprintf(file_out,"%Lf",n);return *this;}
	NORMAL_OUT& operator<<(const char c[]){fprintf(file_out,"%s",c);return *this;}
	NORMAL_OUT& operator<<(const string &s){fprintf(file_out,"%s",s.c_str());return *this;}
} normal_out;
struct ERR_OUT{
	template<class T>
		ERR_OUT& operator<<(const T &a){
			cerr<<"\x1b[7m"<<a<<"\x1b[m";
			return *this;
		}
} ferr;
//}}}

//{{{ hash pair, vector
const uint64_t HASH_MOD = 10526209476378151ll;
namespace std {
	template <class S,class T>
	class hash<std::pair<S, T>> {
	public:
		size_t operator()(const std::pair<S, T>& x) const{
			return hash<S>()(x.first) * HASH_MOD + hash<T>()(x.second);
		}
	};
	template <class T>
	class hash<std::vector<T>>{
	public:
		size_t operator()(const std::vector<T>& v) const{
			uint64_t s = 0;
			for(int i=0;i<v.size();i++){
				s *= HASH_MOD;
				s += hash<T>(v[i]);
			}
			return s;
		}
	};
}
//}}}

int N;
const int MAX = 305;

rn dp[MAX][MAX][MAX];

rn calc(int i1,int i2,int i3){
	if(dp[i1][i2][i3]>=-1.0L){
		return dp[i1][i2][i3];
	}else if(i1==0 and i2==0 and i3==0){
		return dp[i1][i2][i3] = 0L;
	}
	rn sum = 0L;
	rn p0 = (N-i1-i2-i3)/(rn)N;
	if(i1>0){
		rn p = i1/(rn)N;
		i1--;
		sum += calc(i1,i2,i3)*p;
		i1++;
	}
	if(i2>0){
		rn p = i2/(rn)N;
		i2--;
		i1++;
		sum += calc(i1,i2,i3)*p;
		i2++;
		i1--;
	}
	if(i3>0){
		rn p = i3/(rn)N;
		i3--;
		i2++;
		sum += calc(i1,i2,i3)*p;
		i3++;
		i2--;
	}
	return dp[i1][i2][i3] = (sum + 1.0L)/(1.0L-p0);
}


int main(){
	REP(i,MAX)REP(j,MAX)REP(k,MAX)dp[i][j][k] = -100;
	int i1=0,i2=0,i3=0;
	fin>>N;
	REP(i,N){
		int a;
		fin>>a;
		if(a==1)i1++;
		else if(a==2)i2++;
		else if(a==3)i3++;
		else assert(false);
	}
	printf("%.10Lf\n",calc(i1,i2,i3));
}

Measured memory_bytes: 443648