import java.util.*; public class Run { public static void main (String arg[]) { Scanner scan = new Scanner(System.in); String S = scan.next(); int Road = 1; for (int i = 0; i < S.length(); i++) { if (S.charAt(i)=='L') Road = Road*2; else Road = Road*2 + 1; } System.out.println(Road); } }