M = list(map(str, input())) l = len(M) count = 1 for i in range(l): if M[i] == "L": count *= 2 elif M[i] == "R": count = count * 2 + 1 print(count)