# yukicoder No.104 国道 S = input() N = 1 for i in S: if i == "L": N = 2 * N else: N = 2 * N + 1 print(N)