S = input() c = 1 for s in S: c = [c * 2, c * 2 + 1]['LR'.index(s)] print(c)