# coding: utf-8 r = input() s = 1 for i in r: if i == "L": s *= 2 else: s = s*2 + 1 print(s)