S = list(input()) v = 1 for b in S: if b == 'L': v = v * 2 else: v = v * 2 + 1 print(v)