package main import . "fmt" func main() { r:=int64(1) for { var c rune Scanf("%c",&c) if c<65 { Println(r) return } if c=='L' { r*=2 } else { r=r*2+1 } } }