def main(): S = input() print(get_result(S)) def get_result(string): if len(string) == 0: return 0 binary = string.replace('L', '0').replace('R', '1') ordinary = int(binary, 2) #print(ordinary) start = 2 ** len(string) #print(start) return (start + ordinary) if __name__ == '__main__': main()