def walk_national_root(root, branch_root): courent_root = root for i in range(len(branch_root)): if branch_root[i] == "L": courent_root = courent_root * 2 elif branch_root[i] == "R": courent_root = courent_root * 2 + 1 return courent_root def main(): root = 1 try: branch_root = list(input()) answer = walk_national_root(root, branch_root) print(answer) except EOFError as e: print(root) if __name__ == "__main__": main()