from collections import * from itertools import * from functools import * from heapq import * import sys,math input = sys.stdin.readline S = list(input())[:-1] n = len(S) now = 1 for s in S: if s=='L': now *= 2 else: now = 2*now + 1 print(now)