import sys dump = lambda *x : print(*x, file = sys.stderr) try: s = input() except EOFError: print(1) exit() x = 1 for c in s: if c == 'L': x = x * 2 else: x = x * 2 + 1 print(x)