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