S=input() S1=list (S) S1.reverse() H=0 K=1 i=0 for i in range (len(S1)): if S1[i]=="R": H+=K K*=2 i+=1 H+=K print (H)