S=input()
N=len(S)
M=2**N
x=0
while x<N:
	if S[x]=="R":
		M += 2**(N-x-1)
	x+=1
print(M)