import java.io.*; import java.util.*; import java.math.*; class Main104 { public static void out (Object out) { System.out.println(out); } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int ans = 0; String s = br.readLine(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == 'R') { ans += (int)Math.pow(2, s.length() - i - 1); } } out(ans + (int)Math.pow(2, s.length())); } }