#include <bits/stdc++.h>

using namespace std;

int n;

const int M = 303;

double dp[M][M][M];


double f(int i, int j, int k){
	if(i+j+k==0){
		return 0;
	}
	if(i < 0 || i > n || j < 0 || j > n || k < 0 || k > n ){
		return 0;
	}
	if(dp[i][j][k] > 0.00001) return dp[i][j][k];
	double total = i+j+k;
	return dp[i][j][k] = i/total * f(i-1,j,k) + (j/total) * f(i+1,j-1,k) + (k / total) * f(i,j+1,k-1) + n / total;
}

int main(){
	cin >> n;
	vector<int> a(4,0);
	for(int i = 0; i < n; i++){
		int x; cin >> x;
		a[x]++;
	}
	cout << fixed << setprecision(16) << f(a[1],a[2],a[3]) << "\n";
	return 0;
}
