import java.util.*; public class Main { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); //分岐の方向 String S = sc.nextLine(); long rute = 1; for(int i = 0; i < S.length(); i++) { char c = S.charAt(i); if(c == 'L') { rute = rute * 2; } else { rute = rute * 2 + 1; } } System.out.println(rute); } }