  integer,dimension(10000)::a
  read*,in
  do i=1,in
     read*,ia
     a(i)=ia
  end do
 
  ix=0
  do k=1,100000
     iper2=0
     do i=1,in
        if (mod(a(i),2)==0) then
           a(i)=a(i)/2
           iper2=1
           ix=ix+1
           do j=i+1,in
              a(j)=3*a(j)
           end do
           exit
        else 
           a(i)=3*a(i)
        end if
     end do
      if (iper2==0) go to 2
1 end do

2 print*,ix
end program