l = list(input()) x = 1 for i in l: if i == "L": x = 2 * x elif i == "R": x = 2 * x + 1 print(x)