import sys def input(): return sys.stdin.readline().rstrip() S = input() now = 1 for s in S: if s == "L": now *= 2 else: now = now*2+1 print(now)