s = input() bunki = len(s) kokudo = 2 ** bunki lr = kokudo for i in range(bunki): lr = lr // 2 if s[i] == "R": kokudo = kokudo + lr print(kokudo)