/* Pain. Anger. Hatred. Ego.
                                                      Survive. Live. Win. Conquer. */

                                                          /*#Quota_Reform .
                                                        #We_Want_Safe_Roads .
                                                          #We_Want_Justice .
                                                            #Support_Us .
                                                            #Bangladesh .
                                                          */


#include<bits/stdc++.h>
using namespace std;
typedef long long LL ;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

#define ook order_of_key
#define fbk find_by_order
#define bug printf("Massacre.\n");
#define pf printf
#define sf scanf
#define pb push_back
#define r0 return 0
#define ff first
#define ss second
#define mp make_pair
#define set0(a) memset ((a), 0 , sizeof(a))
#define set1(a) memset((a),-1,sizeof (a))
#define si(a) scanf("%d" , &a)
#define sl(a) scanf("%lld" , &a)
#define sii(a,b) scanf("%d %d" , &a , &b)
#define siii(a,b,c) scanf("%d %d %d" , &a , &b, &c)
#define sll(a,b) scanf("%lld %lld" , &a , &b)
#define slll(a,b,c) scanf("%lld %lld %lld" , &a , &b, &c)
#define pll pair <LL, LL>
#define pii pair <int, int>
#define vi  vector <int>
#define vl  vector <LL>
#define all(x) (x).begin(), (x).end()
#define vii vector <pair <int, int> >
#define vll vector < pair <LL, LL> >
#define mod 1000000007

//using namespace __gnu_pbds;
//typedef tree < int, null_type ,less<int>,rb_tree_tag,tree_order_statistics_node_update > ordered_set;

void func(void)
{
        freopen("input.c","r",stdin);
        freopen("output.c","w",stdout);
}

void print(vector <LL> &v){
    cout << v.size() << endl;
    for(int i = 0; i < v.size(); i++){
        pf("%lld ", v[i]);
    }
    pf("\n");
}

void print(vector <pll> &v){
    cout << v.size() << endl;
    for(int i = 0; i < v.size(); i++){
        pf("%lld %lld\n", v[i].ff, v[i].ss);
    }
}

void print(double d){
    cout << fixed << setprecision(10) << d << endl;
}

void print(string s, double d){
    cout << s << " ";
    cout << fixed << setprecision(10) << d << endl;
}

const int N = 302;
bool vis[N][N][N];
long double dp[N][N][N];
LL n;
long double calc(LL i, LL j, LL k){
    if(i < 0 or j < 0 or k < 0)return 0.0;
    if(i == 0 and j == 0 and k == 0)return 0;
    bool &v = vis[i][j][k];
    if(v)return dp[i][j][k];
    v = 1;
    long double x = (long double) (i * 1.0)/n * (1.0 + calc(i - 1, j + 1, k));
    x += (long double) (j * 1.0)/n * (1.0 + calc(i, j - 1, k + 1));
    x += (long double) (k * 1.0)/n * (1.0 + calc(i, j, k - 1));
    long double temp = (long double) 1.0 * (n - i - j - k) / n;
    x += temp;
    temp = 1.0 - temp;
    x /= temp;
    return dp[i][j][k] = x;
}

LL a[5];
int main(){
//    ios_base::sync_with_stdio(0); cin.tie(0);
    LL q, i,j = 0, temp, t, k, ans = 0, sum = 0, x, y, z, cnt = 0, m, fg = 0, mx = 0, mx1 = 0, mn = 8000000000000000000, mn1 = 8000000000000000000;
    sl(n);
    for(int i = 0; i < n; i++){
        sl(x);
        a[x]++;
    }
    cout << fixed << setprecision(12) << calc(a[3], a[2], a[1]) << endl;
}


Measured memory_bytes: 454912