#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int Inf = 2000000010;
constexpr ll INF= 2000000000000000000;
constexpr ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<int,int> P;

template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}

ll mod(ll val) {
    ll res = val % MOD;
    if(res < 0) {
        res += MOD;
    }
    return res;
}

// N^P mod M（ただしM == -1の時はmodを取らない）
template<typename T>
T RS(T N, T P, T M){
    if(P == 0) {
        return 1;
    }
    if(P < 0) {
        return 0;
    }
    if(P % 2 == 0){
        ll t = RS(N, P/2, M);
        if(M == -1) return t * t;
        return t * t % M;
    }
    if(M == -1) {
        return N * RS(N,P - 1,M);
    }
    return N * RS(N, P-1, M) % M;
}

int N;
bool flag[310][310][310];
double dp[310][310][310];

double solve(int a,int b,int c) {
    if(flag[a][b][c]) {
        return dp[a][b][c];
    }
    flag[a][b][c] = true;
    if(a == 0 && b == 0 && c == 0) {
        return dp[a][b][c] = 0;
    }
    double fans = 1 / ( 1 - (double)(N - a - b - c) / N);
    if(a > 0) {
        fans += solve(a - 1,b,c) * a / N / (1 - (double)(N - a - b - c) / N);
    }
    if(b > 0) {
        fans += solve(a + 1,b - 1,c) * b / N / (1 - (double)(N - a - b - c) / N);
    }
    if(c > 0) {
        fans += solve(a,b + 1,c - 1) * c / N / (1 - (double)(N - a - b - c) / N);
    }
    return dp[a][b][c] = fans;
}

int main() {
    cin >> N;
    int one = 0;
    int two = 0;
    int three = 0;
    for(int i = 0;i < N;i++) {
        int A;
        cin >> A;
        if(A == 1) {
            one++;
        }
        else if(A == 2) {
            two++;
        }
        else {
            three++;
        }
    }
    for(int i = 0;i < 310;i++) {
        for(int j = 0;j < 310;j++) {
            for(int k = 0;k < 310;k++) {
                flag[i][j][k] = false;
            }
        }
    }
    cout << fixed;
    cout << setprecision(12) << solve(one,two,three) << endl;
}         
// @author: khangtq1
#include <bits/stdc++.h>

using namespace std;

#define fto(i, a, b) for(int i = a; i < b; ++i)
#define fdto(i, a, b) for(int i = b - 1; i >= a; --i)
#define rep(i, n) for(int i = 0; i < n; ++i)
#define fill(arr, val) memset(arr, val, sizeof(arr))
#define what_is(x) cerr << #x << " is " << x << "\n"
#define setpre(x) fixed << setprecision(x)

#define all(arr) (arr).begin(), (arr).end()
#define pb push_back
#define mp make_pair
#define pqueue priority_queue
#define unmap unordered_map //hashmap
#define unset unordered_set //hashset
#define mtset multiset
#define endl '\n'

using ll = long long;
using db = double;
using ii = pair<int, int>;
using vi = vector<int>;

const db PI = acos(-1);

#define MOD 1000000007

void solve();

/// ================================ main ==============================

int main() {
	//ios::sync_with_stdio(false);
	//cin.tie(nullptr);
	int tt =1;
	//cin >> tt;
	while(tt--) {
		solve();
	}
	return 0;	
}

/// ================================ solve =============================

const int MAXN = 305;
double p[MAXN][MAXN][MAXN], ev[MAXN][MAXN][MAXN	];

void solve() {
	int n;
    scanf("%d", &n);
    vector<int> cnt(4);
    for(int i = 0; i < n; ++i) {
        int x;
        scanf("%d", &x);
        ++cnt[x];
    }
    p[cnt[1]][cnt[2]][cnt[3]] = 1;
    for(int c = n; c >= 0; --c) {
        for(int b = n; b >= 0; --b) {
            for(int a = n; a >= 0; --a) {
                if(a == 0 && b == 0 && c == 0) {
                    continue;
                }
                if(a + b + c > n) {
                    continue;
                }
                // dp[a][b][c]
                
                double p_waste = (double) (n - (a + b + c)) / n;
                // p_waste + p_waste^2 + ... = S
                // 1 + S = S / p_waste
                double ev_waste = p_waste / (1 - p_waste) + 1;	                
                ev[a][b][c] += ev_waste * p[a][b][c];
                
                // remove 1 -> dp[a-1][b][c]
                // we will eventually choose one of a+b+c
                if(a != 0) {
                    double p_go = (double) a / (a + b + c);
                    p[a-1][b][c] += p[a][b][c] * p_go;
                    ev[a-1][b][c] += ev[a][b][c] * p_go;
                }
                
                // remove 2 -> dp[a+1][b-1][c]
                if(b != 0) {
                    double p_go = (double) b / (a + b + c);
                    p[a+1][b-1][c] += p[a][b][c] * p_go;
                    ev[a+1][b-1][c] += ev[a][b][c] * p_go;
                }
                
                // remove 3
                if(c != 0) {
                    double p_go = (double) c / (a + b + c);
                    p[a][b+1][c-1] += p[a][b][c] * p_go;
                    ev[a][b+1][c-1] += ev[a][b][c] * p_go;
                }
            }
        }
    }
    printf("%.10lf\n", ev[0][0][0]); // + cnt[1] + 2 * cnt[2] + 3 * cnt[3]);
}

/*
==================================+
INPUT:                            |
3
1 1 1
==================================+
OUTPUT:                           |
5.5
==================================+
*/

