S = input() S = list(S) X = 1 if len(S) == 0: print(X) else: for i in range(len(S)): if S[i] == "L": X = X*2 else: X = X*2+1 print(X)