#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

double dp[304][304][304];
int a[4];
int main(){
    int n,ai;
    cin>>n;
    rep(i,n){
        cin>>ai;
        ++a[ai-1];
    }
    rep(i,n+1)rep(j,n+1)rep(k,n+1){
        int c=i+j+k;
        if(c==0) continue;
        if(k!=0) dp[k][j][i]+=dp[k-1][j][i]*k;
        if(j!=0) dp[k][j][i]+=dp[k+1][j-1][i]*j;
        if(i!=0) dp[k][j][i]+=dp[k][j+1][i-1]*i;
        dp[k][j][i]+=n;
        dp[k][j][i]/=c;
    }
    cout<<setprecision(10)<<fixed<<dp[a[0]][a[1]][a[2]]<<endl;
    return 0;
}
