//#############################################################################
#include "bits/stdc++.h"
//#############################################################################
//Macros 
#define MOD 1000000007
#define eb emplace_back
#define mp make_pair
#define fr first
#define sc second
#define vec vector
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define alla(a, n) a, a + n
//Type Defs
typedef long long ll;
typedef unsigned long long ull;
//#############################################################################
using namespace std;
//#############################################################################
//Helpers
void io_handler()
{
#ifdef LOCAL_TESTING
    freopen("inputf.in", "r", stdin);
    freopen("outputf.in", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
template <typename T>
void print_matrix(vector<vector<T>> mat){
    for(auto row: mat){
        for(auto e : row){cout << e << " ";}
        cout << endl;
    }
}
template <typename T>
void print_vector(vector<T> v){
    for(auto e : v){cout<< e <<" ";}
    cout<<endl;
}
template <typename T>
map<T,T> get_count(vector<T> v){
    map<T,T> count;
    for(auto e: v){
        if(count.find(e)!=count.end()){count[e]++;}
        else{count[e] = 1;}}
    return count;
}
//#############################################################################
//Solution
void solve(){
    ll n ; cin>>n;
    ll ones = 0LL, twos  = 0LL, threes = 0LL;
    for(ll i =0; i<n; i++){
        int x; cin>>x;
        if(x==1){++ones;}
        else if(x==2){++twos;}
        else{++threes;}
    }
    ll mx1 = ones + twos + threes;
    ll mx2 = twos + threes;
    ll mx3 = threes;
    double dp[n+1][n+1][n+1];
    memset(dp,0.0,sizeof(dp));
    ll i,j,k;
    for(i = 0LL; i<mx3+1; i++){
        for(j = 0LL; j<mx2+1-i; j++){
            for(k = 0LL; k<mx1+1-i-j; k++){
                if(i==j and j==k and i==0LL){
                    continue;
                } else {
                    dp[k][j][i] = (1.0*n)/((i*1.0)+(j*1.0)+(k*1.0));
                    if(i!=0LL){
                        dp[k][j][i] += dp[k][j+1][i-1]*
                        ((i*1.0)/(((i*1.0)+(j*1.0)+(k*1.0))));
                    }
                    if(j!=0LL){
                        dp[k][j][i] += dp[k+1][j-1][i]*
                        ((j*1.0)/(((i*1.0)+(j*1.0)+(k*1.0))));
                    }
                    if(k!=0LL){
                        dp[k][j][i] += dp[k-1][j][i]*
                        ((k*1.0)/(((i*1.0)+(j*1.0)+(k*1.0))));
                    }
                }
            }
        }
    }
    cout<<setprecision(16)<<dp[k-1][j-1][i-1]<<endl;
}
//#############################################################################
//Driver
int main()
{
    io_handler();
    int t = 1;
    //cin>>t;
    for (int i = 0; i < t; i++){
        solve();
    }
#ifdef LOCAL_TESTING
    cout << "⏰ Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}
//#############################################################################


Measured memory_bytes: 213376