l=input() ans,tmp=0,1 for i in l: if i=="L":tmp*=2 else:tmp=tmp*2+1 print(tmp)