s = input() c = 1 flag = False for ss in s: flag = True if ss == 'R': c = c * 2 + 1 elif ss == 'L': c = c * 2 if flag: print(c) else: print(1)