S = input() i = 1 for v in S: if v == 'L': i *= 2 else: i = 2 * i + 1 print(i)