import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); sc.close(); char dir[] = s.toCharArray(); int bunki = 1; int RoadCount = 1; int countR = 0; for (int i = 0; i < dir.length; i++) { bunki *=2; RoadCount+= bunki; } RoadCount -= bunki; for (int i = 0; i < dir.length; i++) { if(dir[i] == 'R'){ bunki /= 2; } } System.out.println(RoadCount+bunki); } }