S = input() A = [i for i in range(2**len(S), 2**len(S)*2)] start = 0 end = len(A)-1 for c in S: if c == 'L': end = (end - start)//2 + start else: start = (end - start)//2 + start + 1 print(A[start])