r=1 while True: try: s = input() # Python 2.x と Python 3.x で input() の挙動が異なるので注意 #if s == '': # 空行の場合、line の中身は空文字列 #break for i in range(len(s)): if s[i]=="L": r=r*2 else: r=r*2+1 except EOFError: break print(r)