s = str(input()) ans = 1 for c in s: if c == 'L': ans = 2*ans else: ans = 2*ans+1 print(ans)