cnt=1 for i in input(): if i=='L': cnt=2*cnt else: cnt=2*cnt+1 print(cnt)