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