main=getLine>>=print.foldl(\r c -> if c=='L' then 2*r else 1+2*r) 1