#include "iostream"
#include "fstream"
#include "algorithm"
#include "iomanip"
#include "stack"
#include "queue"
#include "string"
#include "vector"
#include "map"
#include "set"
#include "list"
#include "deque"
#include "complex"
#include "bitset"
#include "cmath"
#include "unordered_set"
#include "unordered_map"
#include "iterator"
#include <ctime>
#include <cassert>
#include "numeric"
#include <cstdio>

using namespace std;

//#define f(i,n) for(int i=0; i<n;i++) 
//#define rf(i, n) for(int i=n-1;i>=0;i--)
//#define forn(i, j, n) for(int i=j; i<n; i++)
//#define ff(i, j, n) f(i, n)f(j, n)
#define pb push_back
#define maxi(a,b) a = max(a, b);
#define mini(a,b) a = min(a, b);
#define endl '\n'
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sqr(x) ((x) * (x))
#define SZ(a) ((int)(a.size()))
#define watch(x) cout << (#x) << " = " << x << endl;
//typedef long long ll;
typedef long double ld;
#define int long long
#define double ld
typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<pii> vpii;
typedef vector<char> vc;

template<class T>
void show(const vector<T> &a)
{
	for (T x : a)
		cout << x << " ";
	cout << endl;
}

const int sze = 3e5 + 50, oo = 1e18 + 500, mod1 = 1e9 + 7, mod = 998244353;
const double eps = 1e-9, PI = 2 * acos(0.0);
vi vertices[sze];
vi visit(sze, 0);
vc used(sze, false);
vi arr(sze, 0);
int n, m, k;
int A, B;
int cnt = 0;

double dp[310][310][310];
int acnt[3];

//int dp[10010][110];
//int dpe[10010][10][110];

signed main() 
{
	ios::sync_with_stdio(0);
	cout.tie(0); cin.tie(0);

	/*string s;
	cin >> s >> m;
	n = SZ(s);

	for (int i = 1; i <= 9; i++)
	{
		dp[1][i % m] ++;
	}

	for (int i = 2; i < n; i++)
	{
		for (int j = 0; j < m; j++)
		{
			for (int z = 0; z <= 9; z++)
			{
				dp[i][(j + z) % m] = (dp[i - 1][j] + dp[i][(j + z) % m]) % mod;
			}
		}
	}

	int ans = 0;
	for (int i = 1; i < n; i++)
	{
		ans = (ans + dp[i][0]) % mod;
	}

	for (int i = 1; i <= s[0] - '0'; i++)
	{
		dpe[0][i][i % m]++;
	}

	for (int i = 1; i < n; i++)
	{
		for (int j = 0; j <= 9; j++)
		{
			for (int z = 0; z < m; z++)
			{
				if (j == s[i - 1] - '0')
				{
					for (int a = 0; a <= s[i] - '0'; a++)
					{
						dpe[i][a][(z + a) % m] = (dpe[i][a][(z + a) % m] + dpe[i-1][j][z]) % mod;
					}
				}
				else
				{
					for (int a = 0; a <= 9; a++)
					{
						dpe[i][a][(z + a) % m] = (dpe[i][a][(z + a) % m] + dpe[i - 1][j][z]) % mod;
					}
				}
			}
		}
	}

	for (int i = 0; i <= 9; i ++)
	{
		ans = (ans + dpe[n - 1][i][0]) % mod;
	}

	cout << ans;*/

	cin >> n;

	for (int i = 0; i < n; i++)
	{
		int val;
		cin >> val;
		acnt[val - 1]++;
	}

	for (int z = 0; z <= n; z++)
	{
		for (int j = 0; j <= n; j++)
		{
			for (int i = 0; i <= n; i++)
			{
				if (i+j+z)
					dp[i][j][z] = 1;

				if (i - 1 >= 0)
				{
					double val = (double)i / (double)n;
					dp[i][j][z] += dp[i - 1][j][z]*val;
				}

				if (j - 1 >= 0)
				{
					double val = (double)j / (double)n;
					dp[i][j][z] += dp[i + 1][j - 1][z] * val;
				}

				if (z - 1 >= 0)
				{
					double val = (double)z / (double)n;
					dp[i][j][z] += dp[i][j + 1][z - 1] * val;
				}

				double val = (double)(i + j + z) / (double)n;
				if (val)
					dp[i][j][z] /= val;
			}
		}
	}

	cout << fixed << setprecision(15) << dp[acnt[0]][ acnt[1]][ acnt[2]];
	return 0;
}

Measured memory_bytes: 465408