program W implicit none character(100000)::S integer::A=1 integer::i read*,S do i=1,len_trim(S) if(S(i:i)=="L")A=2*A if(S(i:i)=="R")A=2*A+1 end do print"(i0)",A end program W