text = input() ans = 1 for i in range(len(text)): if text[i] == "L": ans *= 2 else: ans = ans*2 + 1 print(ans)