package main import . "fmt" func main() { var s string Scan(&s) var dp [9][4]int dp[0][0]=1 for i,c:=range s { var x int switch c { case 'l','o': x=1 case 'a','s': x=2 } for k,v:=range dp[i][:] { dp[i+1][k|x]+=v } } Println(dp[8][3]) }