t = 1 for b in list(input()): if b == "L": t = t * 2 else: t = t * 2 + 1 print(t)