program test
implicit none
integer :: i,n,a(300),aa(3)=0,nokori,i1,i2,i3
real(8) :: p(0:300,0:300,0:300)=0,e(0:300,0:300,0:300)=0,psum,esum

read(*,*) n
read(*,*) (a(i),i=1,n)

do i=1,n
	aa(a(i)) = aa(a(i)) + 1
enddo

nokori = aa(1)+aa(2)*2+aa(3)*3

!分岐の確率
p(aa(1),aa(2),aa(3)) = 1

esum = 0

do 
	
	do i3 = 0,int(nokori/3)
		do i2 = 0,int((nokori-i3*3)/2)
			i1 = nokori-i2*2-i3*3
			
			if(i1>=1) then
				p(i1-1,i2,i3) = p(i1-1,i2,i3) +  p(i1,i2,i3) * (i1)/dble(i1+i2+i3)
				e(i1-1,i2,i3) = e(i1-1,i2,i3) + n/dble(i1) * p(i1,i2,i3) * (i1)/dble(i1+i2+i3)
				esum = esum + n/dble(i1+i2+i3) * p(i1,i2,i3) * (i1)/dble(i1+i2+i3)
			endif
			
			if(i2>=1) then
				p(i1+1,i2-1,i3) = p(i1+1,i2-1,i3) +  p(i1,i2,i3) * (i2)/dble(i1+i2+i3)
				e(i1+1,i2-1,i3) = e(i1+1,i2-1,i3) + n/dble(i2) * p(i1,i2,i3) * (i2)/dble(i1+i2+i3)
				esum = esum + n/dble(i1+i2+i3) * p(i1,i2,i3) * (i2)/dble(i1+i2+i3)
			endif
			
			if(i3>=1) then
				p(i1,i2+1,i3-1) = p(i1,i2+1,i3-1) +  p(i1,i2,i3) * (i3)/dble(i1+i2+i3)
				e(i1,i2+1,i3-1) = e(i1,i2+1,i3-1) +  n/dble(i3) * p(i1,i2,i3) * (i3)/dble(i1+i2+i3)
				esum = esum +  n/dble(i1+i2+i3) * p(i1,i2,i3) * (i3)/dble(i1+i2+i3)
			endif
			
		enddo
	enddo
	
	nokori = nokori - 1
		
	if(nokori == 0)then
		goto 100
	endif
	
enddo

100 continue

write(*,*) esum

end program