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