#include <bits/stdc++.h>
using namespace std;
const long long I1 = 1e9;
const long long I2 = 1e18;
const int32_t M1 = 1e9 + 7;
const int32_t M2 = 998244353;
template <typename T, typename T1>
T maxn(T &a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T minn(T &a, T1 b) {
  if (b < a) a = b;
  return a;
}
int n;
long double dp[301][301][301];
void solve() {
  cin >> n;
  int a[4] = {0};
  for (long long int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[x]++;
  }
  for (long long int k = 0; k < a[3] + 1; k++) {
    for (long long int j = 0; j < a[2] + 1 + a[3] - k; j++) {
      for (long long int i = 0; i < a[1] + 1 + a[2] + a[3] - k - j; i++) {
        if (i == j && j == k && i == 0) continue;
        dp[i][j][k] = (long double)(n) / (i + j + k);
        if (i)
          dp[i][j][k] += ((long double)(i) / (i + j + k)) * dp[i - 1][j][k];
        if (j)
          dp[i][j][k] += ((long double)(j) / (i + j + k)) * dp[i + 1][j - 1][k];
        if (k)
          dp[i][j][k] += ((long double)(k) / (i + j + k)) * dp[i][j + 1][k - 1];
      }
    }
  }
  cout << fixed << setprecision(10) << dp[a[1]][a[2]][a[3]] << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int testcase = 1;
  while (testcase--) solve();
  return 0;
}
