s = input() num_now = 1 for i, char in enumerate(s): if char == 'L': num_now = num_now*2 else: num_now = num_now*2+1 print(num_now)