S = input() i=1 for value in S: i = i * 2 if value == R: i += 1 print(i)