#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>
#include <numeric>
#include <string.h>
 
 
#define fs first
#define sc second
 
using namespace std;
 
typedef long long ll;
typedef pair<ll, ll> P;
 
const ll mod = 1e9+7;
ll fact[210200];
ll invfact[210200];
 
inline ll take_mod(ll a){
    return (a % mod + mod) % mod;
}
 
inline ll add(ll a, ll b){
    return take_mod(a+b);
}
 
inline ll sub(ll a, ll b){
    return take_mod(a-b);
}
 
 
inline ll mul(ll a, ll b){
    return take_mod(a * b);
}
 
inline ll powMod(ll x, ll n){
    ll res = 1LL;
    while(n > 0){
        if(n & 1) res = mul(res, x);
        x = mul(x, x);
        n >>= 1;
    }
    return res;
}
 
ll mod_inv(ll x){
    return powMod(x, mod-2);
}
 
// nは上限
void make_fact(ll n){
    fact[0] = 1;
    ll res = 1;
    for(int i = 1; i <= n; i++){
        fact[i] = res;
        res = mul(res, i+1);
    }
}
 
// nは上限
void make_invfact(ll n){
    invfact[0] = 1;
    invfact[n] = mod_inv(fact[n]);
    for(int i = n-1; i >= 1; i--){
        invfact[i] = mul(invfact[i + 1], i + 1);
    }
}
 
ll perm(ll n, ll k){
    return mul(fact[n], invfact[n-k]);
}
 
ll comb(ll n, ll k){
    return mul(mul(fact[n], invfact[n-k]), invfact[k]);
}
 
double dp[310][310][310];
 
int main(){
    int N;
    cin >> N;
 
    for(int i = 0; i <= N; i++){
        for(int j = 0; j <= N; j++){
            for(int k = 0; k <= N; k++){
                dp[i][j][k] = 0.0;
            }
        }
    }
    int num1 = 0, num2 = 0, num3 = 0;
    for(int i = 0; i < N; i++){
        int a;
        cin >> a;
        if(a == 1){
            num1++;
        }
        else if(a == 2){
            num2++;
        }
        else{
            num3++;
        }
    }
    dp[0][0][0] = 0.0;
    for(int i = 0; i <= N; i++){
        for(int j = 0; j <= N; j++){
            for(int k = 0; k <= N; k++){
                if(i + j + k > N){
                    break;
                }
                // 寿司が一個の皿から取られる.
                if(i + j + k < N){
                    double tmp = (double)(i + j + k+1) / (double)(N);
                    double tmp2 = (double)(k+1) / ((double)(i + j + k+1));
                    double x = (dp[i][j][k] + 1.0 / tmp) * tmp2;
                    dp[i][j][k+1] += (dp[i][j][k] + 1.0 / tmp) * tmp2;
                    double y = dp[i][j][k+1];
//                    cout << y << endl;
                }
                // 寿司が二個の皿から取られる
                if(k > 0 && j < N){
                    double tmp = (double)(i + j + k) / (double)(N);
                    double tmp2 = (double)(j+1) / (double)(i + j + k);
                    dp[i][j+1][k-1] += (dp[i][j][k] + 1.0 / tmp) * tmp2;
                }
                if(j > 0 && i < N){
                    double tmp = (double)(i+j+k) / (double)(N);
                    double tmp2 = (double)(i+1) / (double)(i + j + k);
                    dp[i+1][j-1][k] += (dp[i][j][k] + 1.0 / tmp) * tmp2;
                }
            }
        }
    }
 
//    for(int i = 0; i <= N; i++){
//        for(int j = 0; j <= N; j++){
//            for(int k = 0; k <= N; k++){
//                cout << dp[i][j][k] << " ";
//            }
//            cout << endl;
//        }
//        cout << endl;
//    }
 
    printf("%.15f\n", dp[num3][num2][num1]);
 
    return 0;
}

Measured memory_bytes: 227584