s = input() cur_road = 1 for c in s: if c == 'L': cur_road *= 2 else: cur_road = cur_road * 2 + 1 print(cur_road)