S=input() l=len(S) print(2**l+sum([2**(l-x-1) for x in range(l) if S[x] is 'R']))