@n = gets.to_i
a = gets.split.map(&:to_i)

@dp = Array.new(@n+1) {Array.new(@n+1) {Array.new(@n+1)}}
@dp[0][0][0] = 0

def calc(x, y, z)
    s = @dp[x][y][z] and return s

    s = @n
    s += calc(x-1, y, z) * x if x > 0
    s += calc(x+1, y-1, z) * y if y > 0
    s += calc(x, y+1, z-1) * z if z > 0

    @dp[x][y][z] = s.fdiv(x + y + z)
end

p calc(a.count(1), a.count(2), a.count(3))