import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val N = in.next().toInt

  val cnt = new Array[Int](4)
  for (_ <- 1 to N)
    cnt(in.next().toInt) += 1

  val dp = Array.ofDim[Double](N+1, N+1, N+1)
  for (z <- 0 to N; y <- 0 to N; x <- 0 to N)
    dp(z)(y)(x) = -1

  dp(0)(0)(0) = 0

  def calc(i1: Int, i2: Int, i3: Int): Double = {
    if (dp(i1)(i2)(i3) != -1)
      dp(i1)(i2)(i3)
    else {
      val numer = N.toDouble +
      (if (i1 == 0) 0 else (i1 * calc(i1-1, i2, i3))) +
      (if (i2 == 0) 0 else (i2 * calc(i1+1, i2-1, i3))) +
      (if (i3 == 0) 0 else (i3 * calc(i1, i2+1, i3-1)))

      val denom = i1 + i2 + i3

      val res = numer / denom

      dp(i1)(i2)(i3) = res

      res
    }
  }

  println(calc(cnt(1), cnt(2), cnt(3)))
}


class InputReader(stream: InputStream) {
  private val reader = new BufferedReader(new InputStreamReader(stream))
  private var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}

