import std.stdio, std.conv, std.string, std.range, std.math, std.algorithm; void main() { auto S = readln.strip; 1.reduce!("b=='L'?a*2:a*2+1")(S).writeln; }