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; for (int i = 0; i < dir.length; i++) { bunki *=2; RoadCount+= bunki; } RoadCount -= bunki; int ans=0; for (int i = 0; i < dir.length -1; i++) { if(dir[i] == 'L'){ bunki /= 2; ans += bunki; } } if(dir[dir.length-1] == 'L') ans += 1; System.out.println(RoadCount+ans); } }