S=input() #print(S) ans=1 for x in S: if x=='L':ans*=2 else:ans=ans*2+1 print(ans)