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