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