import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); long ans = 1; String crlf = System.getProperty("line.separator"); if(!(s.equals(crlf))) { for(int i = 0; i < s.length(); i++) { if(s.charAt(i) == 'L') { ans *= 2; } else { ans = 2 * ans + 1; } } } System.out.println(ans); } }