import std.stdio;
import std.algorithm;
import std.array;
import std.string;
import std.conv;
import std.math;

void main() {
	auto n = readln.chomp.to!long;
	auto a = readln.chomp.split(' ').map!(to!int).array;
	int[4] numbers;
	foreach (e;a) {
		++numbers[e];
	}

	auto dp = new double[][][](n + 1, n + 1, n + 1);

	double solve(int s1, int s2, int s3) {
		if (s1 == 0 && s2 == 0 && s3 == 0) {
			return 0.0;
		}
		if (!dp[s1][s2][s3].isNaN) {
			return dp[s1][s2][s3];
		}

		double result = 0.0;
		if (s1 >= 1) result += solve(s1 - 1, s2, s3) * s1;
		if (s2 >= 1) result += solve(s1 + 1, s2 - 1, s3) * s2;
		if (s3 >= 1) result += solve(s1, s2 + 1, s3 - 1) * s3;
		result += n;
		result /= (s1 + s2 + s3);

		dp[s1][s2][s3] = result;

		return result;
	}

	writefln("%.10f", solve(numbers[1], numbers[2], numbers[3]));
}
