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