#coding: UTF-8 import sys import re import itertools from math import sqrt from collections import deque ### defs ### ### main ### S = sys.stdin.readline().strip('\r\n') ans=1 move = {} move['L'] = lambda x:x*2 move['R'] = lambda x:x*2+1 for c in S: ans = move[c](ans) print(ans)