import std.conv, std.stdio, std.string;
import std.algorithm, std.array, std.bigint, std.container, std.math, std.range, std.regex, std.typecons;
import core.bitop, core.thread;

class EOFException : Throwable { this() { super("EOF"); } }
string[] tokens;
string readToken() { for (; tokens.empty; ) { if (stdin.eof) throw new EOFException; tokens = readln.split; } auto token = tokens[0]; tokens.popFront; return token; }
int readInt() { return readToken().to!int; }
long readLong() { return readToken().to!long; }
real readReal() { return readToken().to!real; }

void chmin(T)(ref T t, in T f) { if (t > f) t = f; }
void chmax(T)(ref T t, in T f) { if (t < f) t = f; }

int binarySearch(T)(in T[] as, in bool delegate(T) test) { int low = -1, upp = cast(int)(as.length); for (; low + 1 < upp; ) { int mid = (low + upp) >> 1; (test(as[mid]) ? low : upp) = mid; } return upp; }
int lowerBound(T)(in T[] as, in T val) { return as.binarySearch((T a) => (a < val)); }
int upperBound(T)(in T[] as, in T val) { return as.binarySearch((T a) => (a <= val)); }


int N;
int[] A;

void main() {
  try {
    for (; ; ) {
      N = readInt();
      A = new int[N];
      foreach (i; 0 .. N) {
        A[i] = readInt();
      }
      const C3 = A.count(3);
      const C2 = A.count(2);
      const C1 = A.count(1);
      auto dp = new real[][][](N + 1, N + 1, N + 1);
      dp[0][0][0] = 0.0;
      foreach (x3; 0 .. N + 1) foreach (x2; 0 .. N + 1) foreach (x1; 0 .. N + 1) {
        if (0 < x3 + x2 + x1 && x3 + x2 + x1 <= N) {
          real nmr = 0.0;
          if (x3 > 0) nmr += (x3 / cast(real)(N)) * dp[x3 - 1][x2 + 1][x1];
          if (x2 > 0) nmr += (x2 / cast(real)(N)) * dp[x3][x2 - 1][x1 + 1];
          if (x1 > 0) nmr += (x1 / cast(real)(N)) * dp[x3][x2][x1 - 1];
          dp[x3][x2][x1] = (1.0 + nmr) / ((x3 + x2 + x1) / cast(real)(N));
        }
      }
      const ans = dp[A.count(3)][A.count(2)][A.count(1)];
      writefln("%.10f", ans);
    }
  } catch (EOFException e) {
  }
}
