#include <bits/stdc++.h>

using namespace std;

const double PI = 3.141592653589;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define int long long
#define ll long long
#define all(c) (c).begin(),(c).end()
#define M 1000000007
#define INF LLONG_MAX
#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
template <class T> void dbs(string str, T t) {cerr << str << " : " << t << "\n";}
template <class T, class... S> void dbs(string str, T t, S... s) {int idx = str.find(','); cerr << str.substr(0, idx) << " : " << t << ", "; dbs(str.substr(idx + 1), s...);}
template <class S, class T>ostream& operator <<(ostream& os, const pair<S, T>& p) {return os << "(" << p.first << ", " << p.second << ")";}
template <class T>ostream& operator <<(ostream& os, const vector<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T>ostream& operator <<(ostream& os, const set<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class S, class T>ostream& operator <<(ostream& os, const map<S, T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T> void prc(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;} cerr << "]\n";}
// Use pr(a,b,c,d,e) or cerr<<anything or prc(v.begin(),v.end()) or prc(v,v+n)
//  


int32_t main()
{
    fastio;
    //freopen("file.in", "r", stdin);
    //freopen("file.out", "w", stdout);
    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> count(3, 0);
    for(int i=0;i<n;i++)
    {
        cin >> a[i];
        count[a[i]-1]++;
    }
    const int N = 300 + 5;
    vector<vector<vector<double>>> prob(N, vector<vector<double>>(N, vector<double>(N, 0)));
    vector<vector<vector<double>>> ev(N, vector<vector<double>>(N, vector<double>(N, 0)));
    prob[count[0]][count[1]][count[2]] = 1;
    for(int k=n;k>=0;k--)
    {
        for(int j=n;j>=0;j--)
        {
            for(int i=n;i>=0;i--)
            {
                if((n < (i+j+k)) or (i==0 and j == 0 and k == 0))
                    continue;
                double p_waste = (double) (n - (i+j+k))/n; 
                // pwaste + pwaste^2 + pwaste^3 + ... // waste something for 1st
                // time , 2nd time and so on
                double ev_waste = (double) p_waste/(1 - p_waste) + 1;
                ev[i][j][k] += ev_waste * prob[i][j][k];
                int z = i+j+k;
                if(i)
                {
                    double p1 = (double)i/z; 
                    prob[i-1][j][k] += prob[i][j][k] * p1;
                    ev[i-1][j][k] += ev[i][j][k] *p1;
                }

                if(j)
                {
                    double p2 = (double) j/z;
                    prob[i+1][j-1][k] += prob[i][j][k] * p2;
                    ev[i+1][j-1][k] += ev[i][j][k] * p2;
                }

                if(k)
                {
                    double p3 = (double) k/z;
                    prob[i][j+1][k-1] += prob[i][j][k] * p3;
                    ev[i][j+1][k-1] += ev[i][j][k] * p3;
                }
            }
        }
    }
    cout << fixed << setprecision(20) << ev[0][0][0] << "\n";
    
    return 0;
}



Measured memory_bytes: 450176