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