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