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