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