#include<bits/stdc++.h>
using namespace std;
int cnt[4],n,x,i;
double dp[301][301][301];
double rec(int a,int b,int c){
	if(b<0||c<0||(n-a-b-c)<0)return 0.0;
	if(a==n)return 0.0;
	if(dp[a][b][c]!=0)return dp[a][b][c];
	return dp[a][b][c]=(rec(a+1,b-1,c)*b/n+rec(a,b+1,c-1)*c/n+rec(a,b,c+1)*(n-a-b-c)/n+1)*n/(n-a);
}
int main(){
	cin>>n;
	for(i=0;i<n;i++)cin>>x,cnt[x]++;
	cout<<fixed<<setprecision(10)<<rec(cnt[0],cnt[1],cnt[2]);
}