import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int current = 1; for (char c : sc.next().toCharArray()) { if (c == 'L') { current *= 2; } else { current = current * 2 + 1; } } System.out.println(current); } }