selections = input() road = 1 for i in range(len(selections)): if selections[i]=="L": road *=2 else: road = road*2+1 print(road)