S = input() r = 1 if len(S) == 1 and S == 0 or S == "": print(r) else: for s in S: if s == 'L': r *= 2 else: r = r * 2 + 1 print(r)