#include <bits/stdc++.h>
using namespace std;
#define int long long

int N;
double memo[110][110][110];

double rec(int i, int j, int k) {
    if (memo[i][j][k] >= 0) return memo[i][j][k];
     
    double res = 0;
    
    if (i > 0) res += i*rec(i-1, j+1, k);
    if (j > 0) res += j*rec(i, j-1, k+1);
    if (k > 0) res += k*rec(i, j, k-1);
    res += N;
    res /= i+j+k;
    
    return memo[i][j][k] = res;
}

signed main() {
    cin >> N;
    int zero=0, one=0, two=0;
    
    for (int i=0; i<N; i++) {
        int ai; cin >> ai;
        
        if (ai == 0) zero++;
        else if (ai == 1) one++;
        else if (ai == 2) two++;
    }
    
    memset(memo, -1, sizeof(memo));
    memo[0][0][0] = 0;
    
    cout << setprecision(10) << rec(zero, one, two) << endl;
}