S = input() if S == '': print(1) exit() sL = len(S) ANS = 0 for i in range(sL): if S[i] == 'R': ANS += 2**(sL - i -1) ANS += 2**(sL) print(ANS)