L = [str(x) for x in str(input())] n = 1 for x in L: if x == 'L': n *= 2 else: n = n*2 + 1 print(n)