fun main() { val S = readLine()!! var n = 1 S.forEach { n = if (it == 'L') n * 2 else n * 2 + 1 } println(n) }