#include <bits/stdc++.h>
using namespace std;
#define long long ll
#define f(i,n) for(int i=0;i<n;i++)
const int maxn=305;
double dp[maxn][maxn][maxn];
double recur(int k, int b, int c,int n){
	if(dp[k][b][c]>=0)return dp[k][b][c];
	if(k==0&&b==0&&c==0)return 0.0;
	double res=0.0;
	// dp[k][b][c]=0.0;
	if(k>0)res+=(k)*recur(k-1,b,c,n);
	if(b>0)res+=(b)*recur(k+1,b-1,c,n);
	if(c>0)res+=(c)*recur(k,b+1,c-1,n);
	// dp[k][b][c]/=(n-k-c-b);
	res+=n;
	res*=1.0/(k+b+c);
	return dp[k][b][c]=res;
}
int main() {

	cout<<fixed<<setprecision(10);
	int n;
	cin>>n;
	vector<int>a(4,0);
	f(i,n){int x;
	cin>>x;
	a[x]++;
	}
	memset(dp, -1, sizeof(dp));
	cout<<fixed<<setprecision(9)<<recur(a[1],a[2],a[3],n)<<endl;

	return 0;
}

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

double dp[305][305][305];

int main(){
  int n, a;
  cin >> n;
  vector<int> sushi(3);
  for(int i=0; i<n; ++i){
    cin >> a;
    ++sushi[a-1];
  }
  int sum1 = sushi[2];
  int sum2 = sushi[1] + sushi[2];
  int sum3 = sushi[0] + sushi[1] + sushi[2];
  for(int k=0; k <= sum1; ++k) for(int j=0; j+k <= sum2; ++j) for(int i=0; i+j+k <=sum3; ++i){
    if(i>0) dp[i][j][k] += (dp[i-1][j][k] +(double)n/(i+j+k)) *i /(i+j+k);
    if(j>0) dp[i][j][k] += (dp[i+1][j-1][k] +(double)n/(i+j+k)) *j /(i+j+k);
    if(k>0) dp[i][j][k] += (dp[i][j+1][k-1] +(double)n/(i+j+k)) *k /(i+j+k);
  }
  printf("%.15f\n",dp[sushi[0]][sushi[1]][sushi[2]]);
}