S = input() ans = 1 for s in S: if s == "L": ans = ans * 2 else: ans = ans * 2 + 1 print(ans)