print(int(("R"+input()).replace("R","1").replace("L","0"),2))