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