s = input() ret = 1 for c in s: if c=='L': ret *= 2 else: ret = ret*2 + 1 print(ret)