import java.util.Scanner; class C{ public static void main(String[]$){ int v=1; Scanner s=new Scanner(System.in); if(s.hasNext()) for(char c:s.next().toCharArray()) { if(c=='L')v*=2; if(c=='R')v+=v+1; } System.out.println(v); } }