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