from functools import reduce S = input() print(2**len(S) + reduce(lambda a, b: [0]*len(a)+a if b=="R" else a+[0]*len(a), S[::-1], [1]).index(1))