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