S = raw_input() now = 1 for a in S: if a == "L": now = now * 2 else: now = now * 2 + 1 print now