def get_current_highway(S):
    current_highway = 1  # 最初は1号線からスタート

    for direction in S:
        if direction == 'L':
            current_highway *= 2  # 左に移動するときは国道番号を2倍にする
        else:
            current_highway = current_highway * 2 + 1  # 右に移動するときは国道番号を2倍にして1を加える

    return current_highway

# 入力を受け取る
S = input().strip()

# 現在の国道番号を求める
result = get_current_highway(S)
print(result)