import java.util.*; import java.io.*; public class Exercise124{ public static void main (String[] args) throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String s = new String(in.readLine()); char[] sa = s.toCharArray(); int a = 1; for(int lOrR: sa){ if(lOrR == 'L'){ a *= 2; }else{ a = a * 2 + 1; } } System.out.println(a); } }