#include <bits/stdc++.h>

using namespace std;

int a[4], c[4];
double d[333][333][333];
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		c[a]++;
	}
	for (; a[3] <= c[3]; a[3]++) {
		for (a[2] = 0; a[2] <= n - c[1]; a[2]++) {
			for (a[1] = 0; a[1] <= n; a[1]++) {
				int t = a[1] + a[2] + a[3];
				if (!t) continue;
				double x = n;
				if (a[1]) x += d[a[1] - 1][a[2]][a[3]] * a[1];
				if (a[2]) x += d[a[1] + 1][a[2] - 1][a[3]] * a[2];
				if (a[3]) x += d[a[1]][a[2] + 1][a[3] - 1] * a[3];
				d[a[1]][a[2]][a[3]] = x / t;
			}
		}
	}
	cout.precision(18);
	cout << d[c[1]][c[2]][c[3]] << endl;
	return 0;
}
