/*
 * atcoder/dp/j.cpp
 */

// C++ 14
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <math.h>
#include <cstring>

#define ll long long
#define Int ll
#define loop(__x, __start, __end) for(Int __x = __start; __x < __end; __x++)
#define loopdown(__x, __start, __end) for(Int __x = __start; __x > __end; __x--)
#define rep(__n) for(Int __x = 0; __x < __n; __x++)
#define span(__a,__x,__y) __a.begin()+__x,__a.begin()+__y
#define span_all(__a) __a.begin(),__a.end()
#define len(__x) (__x.size())
#define last(__x) (__x[__x.size()-1])

using namespace std;

template <class T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template <class T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }


struct Point {
  Int x, y;
  Point(Int x, Int y): x(x), y(y) {}
  Point(): x(0), y(0) {}

  Point operator + (Point v) { return Point(x + v.x, y + v.y); }
  Point operator - (Point v) { return Point(x - v.x, y - v.y); }
  bool operator == (const Point &v) const {
    return x == v.x && y == v.y;
  }
  bool operator< (const Point &p1) const {
    return x < p1.x && y < p1.y;
  }
};
ostream & operator << (ostream & out, Point const & v) {
  out << "Point(" << v.x << ", " << v.y << ')';
  return out;
}

istream & operator >> (istream & in, Point & v) {
  Int x, y;
  in >> x; in >> y; v.x = x; v.y = y;
  return in;
}

// Geometry

#define EPS 0.0000000001

class Vector2 {
public:
  double x, y;
  
  Vector2(double x = 0, double y = 0): x(x), y(y) {}
  
  Vector2 operator + (Vector2 v) { return Vector2(x + v.x, y + v.y); }
  Vector2 operator - (Vector2 v) { return Vector2(x - v.x, y - v.y); }
  Vector2 operator * (double k) { return Vector2(x * k, y * k); }
  Vector2 operator / (double k) { return Vector2(x / k, y / k); }
  
  double length() { return sqrt(norm()); }
  double norm() { return x * x + y * y; }
  double dot (Vector2 v) { return x * v.x + y * v.y; }
  double cross (Vector2 v) { return x * v.y - y * v.x; }
  
  bool operator < (const Vector2 &v) const {
    return x != v.x ? x < v.x : y < v.y;
  }
  
  bool operator == (const Vector2 &v) const {
    return fabs(x - v.x) < EPS && fabs(y - v.y) < EPS;
  }
};

ostream & operator << (ostream & out, Vector2 const & v) { 
  out<< "Vector2(" << v.x << ", " << v.y << ')';
  return out;
}

istream & operator >> (istream & in, Vector2 & v) { 
  double x, y;
  in >> x;
  in >> y;
  v.x = x;
  v.y = y;
  return in;
}


vector<Int> slice(vector<Int> &vec, int s, int t) {
  return vector<Int>(vec.begin()+s, vec.begin()+t);
}

vector<Int> trim(vector<Int> &vec, int n) {
  auto init = slice(vec, 0, n);
  auto tail = slice(vec, n+2, vec.size());
  init.insert(init.end(), tail.begin(), tail.end());
  return init;
}

// 一般の期待値E(i,j,k,m)は、空の皿を引く確率をP(m), 1つ、２つ、３つの皿をそれぞれP(i,j,k)とおくと
// i) 空の皿を引いた場合 E(i,j,k) = E(i,j,k) * P(m) + 1
// ii) 1つの皿を引いた場合 E(i,j,k) = E(i-1,j,k) * P(i) + 1
// iii) 2つの皿を引いた場合 E(i,j,k) = E(i+1,j-1,k) * P(j) + 1
// iv) ３つ                 E(i,j,k) = E(i,j+1,k-1) * P(k) + 1
//
// 自己再帰が無いように式変形
// E(i,j,k) = ... + E(i,j,k) * (N - (i+j+k))/N ...
// E(i,j,k) = ... + E(i,j,k) * (1 - (i+j+k)/N) ...
// E(i,j,k) - E(i,j,k) * (1 - (i+j+k)/N) = ...
// E(i,j,k) * (i+j+k)/N = E(i+1,j,k) * i/N + E(i-1,j+1,k) * j/N + E(i,j-1,k+1) * k/N + 1
// E(i,j,k) = (E(i+1,j,k) * i + E(i-1,j+1,k) * j + E(i,j-1,k+1) * k + N) / (i+j+k)

const Int MAX_N = 302;
Int N, I, J, K;
double E[MAX_N][MAX_N][MAX_N];

void input() {
  cin >> N;
  Int a;
  loop(n,0,N) {
    cin >> a;
    if (a == 1) I++;
    else if (a == 2) J++;
    else K++;
  }

  // 初期値が出揃った
}


// 0 0 1 = (0, 1, 0) * 1 + 1
// 0 1 0 = (1, 0, 0) * 1 + 1
// 1 0 0 = (0, 0, 0) * 1 + 1
// 0 0 0 = 0
void receive() {
  E[0][0][0] = 0;
  loop(k,0,N+1) loop(j,0,N+1) loop(i,0,N+1) {
    if (i+j+k == 0) continue;
    E[i][j][k] = 0;
    if (0<i) E[i][j][k] += E[i-1][j][k] * i;
    if (0<j) E[i][j][k] += E[i+1][j-1][k] * j;
    if (0<k) E[i][j][k] += E[i][j+1][k-1] * k;
    E[i][j][k] += N;
    E[i][j][k] *= 1.0/(i + j + k);
    // cout << "(" << i << ", " << j << ", " << k << ") = " << E[i][j][k] << endl;
  }
}

void dump() {
  loop(i,0,I+1) {
    loop(j,0,J+1) {
      loop(k,0,K+1) {
        cout << "(" << i << ", " << j << ", " << k << ") = " << E[i][j][k] << endl;
      }
    }
  }
}

void solve() {
  receive();
  cout << E[I][J][K] << endl;
  // dump();
}

int main() {
  cout.precision(15);
  input();
  solve();
  return 0;
}


Measured memory_bytes: 215296