#include <bits/stdc++.h>
#define int long long int

using namespace std ;

const int N = 320 ;
int n , a , b[3];
long double d[N] , dp[N][N][N] ;

int32_t main(){
	cout << setprecision(20) << fixed ;
	cin >> n ;
	for(int i = 0 ; i < n ; i++){
		cin >> a ;
		b[a - 1]++ ;
	}
	for(int i = 0 ; i <= n ; i++ ){
		int h = 100000 ;
		d[i] = 1 ;
		while(h--){
			d[i] = 1 + (long double)(i * d[i]) / n ;
		}
	}
	for(int k = 0 ; k <= n ; k++){
		for(int j = 0 ; j <= n - k; j++){
			for(int i = 0 ; i <= n - k - j ; i++){
				if(i + j + k == 0)continue ;
				long double dd;
				dp[i][j][k] = d[n - i - j - k];
				if(i){
					dd = i ;
					//dd /= n ;
					dd /= i + j + k ;
					dp[i][j][k] += dd * dp[i - 1][j][k] ;
				}
				if(j){
					dd = j ;
					//dd /= n ;
					dd /= i + j + k ;
					dp[i][j][k] += dd * dp[i + 1][j - 1][k] ;
				}
				if(k){
					dd = k ;
					///dd /= n;
					dd /= i + j + k ;
					dp[i][j][k] += dd * dp[i][j + 1][k - 1] ;
				}
			}
		}
	}
	/*for(int i = 0 ; i <= n ; i++){
		for(int j = 0 ; j <= n ; j++){
			for(int k = 0 ; k <= n; k++){
				cout << dp[i][j][k] << " ";
			}
			cout << '\n';
		}
		for(int j = 0 ; j < n + 5 ; j++){
			cout << '\n' ;
		}
	}*/
	cout << dp[b[0]][b[1]][b[2]];
	return 0 ; 
}
/*
#include <radman/roderc++.h>
                     ....._____
                 .~~~~~////////\\                                                                                           ...
              .:::::////////////\\                                          ....::////////..                              (/\\\\...
           .::::://////   \\\\///\\              .:::://                ..:::::///////////////.                           \\\\\$$$$$$
         \\\\\//////      \\\\///\\           //\\\//////             \\\\\////////////////////.                           ""\\$$$$$$$
         \\\\\////         \\\\////         |||||////////.            \\\\\/////     ~~~~~//////          ...                  "\$$$$
         \\\\\//\         ////|||/          \\\\\/////////            \\\\\//\       ~~~~~//////        (/\\\\...                   .
         \\\\\//\        ////|||/          |||||////*\\///.           \\\\\//\       ~~~~~//////        \\\\\$$$$$$                 .@@@@@.
         \\\\\//\       ////|||/           \\\\\///|\\\////           \\\\\//\       ~~~~~//////         ""\\$$$$$$$               @@@@////\
         \\\\\//\ ____---/|||/            |||||///|\\\\\///.          \\\\\//\       ~~~~~//////             "\$$$$                @@@@\///\
         \\\\\//\--|||||||_-'             \\\\\///|\\\\\////          \\\\\//\       ~~~~~//////                                  ,@@@@|///|
         \\\\\//\|||||_"-\\\\\           |||||///|  ~~~~~///.         \\\\\//\      ~~~~~//////     .@@@@.                    /@@@@@|/////
         \\\\\//\///"""\\\\\\\\          \\\\\///|~~~~[[[////.        \\\\\//\     ~~~~~//////      @@@@@@@@                ..@@@@@.//////
         \\\\\//\    \"""\\\\\\\        |||||///|~~[[[[["\////.       \\\\\//\    ~~~~~//////      '@@@@/////\       .:;@@@@@@@..///////"
         \\\\\//\      \"""\\\\\\       \\\\\///|[[[[*\\\\\////.      \\\\\//\   ~~~~~//////        *@@@\//////\@@@@@@@@..//////////"
         \\\\\//\       \:::\\\\/      |||||///|[[[*   \\\\\\///      \\\\\//\~~~~~///////'            *@@\/////////////////////"
         \\\\\//\        \___\\/       \\\\\///|*       \\\\\/"       \\\\\//\~~////////'                 **"///////////"""
         \\\\\//\                     |||||///|                       \\\\\//\///////"
         \\\\\//\                     \\\\\///|                       \\\\\//\////"
         \\\\\///                    |||||////|                       \\\\\////"
         \\\\\/"                     \\\\\///*                        \\\\\/"
                                     """""*
*/


Measured memory_bytes: 481408