N = 1 for i in input(): if i == "L": N = N*2 else: N = N*2+1 print(N)