ans = 1
S = input()
for s in S:
	if s == "L":
		ans = 2 * ans
	else:
		ans = 2 * ans + 1
print(ans)