#include <bits/stdc++.h>
using namespace std;
typedef long double ld;

ld dp[303][303][303];

int N, CA, CB, CC;

int main() {
	cin >> N;
	for(int i = 0, c; i < N; i++) {
		cin >> c;
		if(1 == c) CA++;
		else if(2 == c) CB++;
		else CC++;
	}

	for(int s = 1, se = CA+CB*2+CC*3; s <= se; s++) {
		for(int c = s/3; 0 <= c; c--) {
			for(int b = min(N, (s-c*3)/2); 0 <= b; b--) {
				int a = s - c*3 - b*2;
				if(N < a) continue;
				ld &ret = dp[a][b][c];
				ret = N;
				if(c) ret += dp[a][b+1][c-1] * c;
				if(b) ret += dp[a+1][b-1][c] * b;
				if(a) ret += dp[a-1][b][c] * a;
				ret /= a+b+c;
			}
		}
	}

	printf("%.30Lf\n", dp[CA][CB][CC]);
	return 0;
}