S = raw_input() road = 1 for s in S: if s == "L": road = 2*road else: road = 2*road+1 print road