S = input()[::-1] pos = 0 for i, c in enumerate(S): if c == "R": pos += 2 ** (i) print(2 ** len(S) + pos)