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