#include using namespace std; #define rep(i,n) for(ll i=0;i=0;i--) #define perl(i,r,l) for(ll i=r-1;i>=l;i--) #define fi first #define se second #define pb push_back #define ins insert #define pqueue(x) priority_queue,greater> #define all(x) (x).begin(),(x).end() #define CST(x) cout<; using vvl=vector>; using pl=pair; using vpl=vector; using vvpl=vector; const ll MOD=1000000007; const ll MOD9=998244353; const int inf=1e9+10; const ll INF=4e18; const ll dy[8]={1,0,-1,0,1,1,-1,-1}; const ll dx[8]={0,-1,0,1,1,-1,1,-1}; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } ll n; double memo[110][110][110]; double dfs(ll a,ll b,ll c){ if(a<0||b<0||c<0)return 0; if(memo[a][b][c]!=-1)return memo[a][b][c]; double ret=1; ret+=dfs(a-1,b+1,c)*a/n; ret+=dfs(a,b-1,c+1)*b/n; ret+=dfs(a,b,c-1)*c/n; ret*=n;ret/=(a+b+c); memo[a][b][c]=ret; return ret; } int main(){ cin >> n; rep(i,110)rep(j,110)rep(k,110)memo[i][j][k]=-1; memo[0][0][0]=0; ll a=0,b=0,c=0; rep(i,n){ ll x;cin >> x; if(x==0)a++; if(x==1)b++; if(x==2)c++; } CST(10); cout << dfs(a,b,c) <