#include <bits/stdc++.h>
using namespace std;

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

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

int main(){
  cin >> N;
  int a=0,b=0,c=0;
  for(int i=0;i<N;++i){
    int n;
    cin >> n;
    if(n==1) a++;
    else if(n==2) b++;
    else c++;
  }
  
  cout << fixed << setprecision(10) << rec(a,b,c) << endl;
  return 0;
}