import java.util.Scanner; public class Main { public static void main(String[] a) { String S=new Scanner(System.in).nextLine(); int n=1;for(char C:S.toCharArray())n=2*n+(C=='L'?0:1); System.out.println(n); } }