#include using namespace std; typedef long long ll; //#include //typedef boost::multiprecision::cpp_ll ll; typedef long double dd; #define i_7 (ll)(1E9+7) //#define i_7 998244353 #define i_5 i_7-2 ll mod(ll a){ ll c=a%i_7; if(c>=0)return c; return c+i_7; } typedef pair l_l; ll inf=(ll)1E16; #define rep(i,l,r) for(ll i=l;i<=r;i++) #define pb push_back ll max(ll a,ll b){if(ab)return b;else return a;} void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]); void Min(ll &pos,ll val){pos=min(pos,val);} void Add(ll &pos,ll val){pos=mod(pos+val);} dd EPS=1E-9; #define endl "\n" #define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll n; double memo[101][101][101]; double hoge(ll i,ll j,ll k){ if(i<0 || j<0 || k<0)return 0; if(i+j+k==0)return 0; double ans=0; ans+=((hoge(i-1,j+1,k)+1)*(double)i); ans+=((hoge(i,j-1,k+1)+1)*(double)j); ans+=((hoge(i,j,k-1)+1)*(double)k); ans+=(double)(n-i-j-k); ans/=(double)(i+j+k); return memo[i][j][k]=ans; } int main(){fastio cin>>n; ll a[n]; ll b[4];rep(i,0,3)b[i]=0; rep(i,0,n-1){ cin>>a[i]; if(a[i]>=3){ b[3]++; }else{ b[a[i]]++; } } double ans=hoge(b[0],b[1],b[2]); cout<