package main import ( "bufio" "fmt" "os" "strconv" ) func main() { sc := bufio.NewScanner(os.Stdin) sc.Split(bufio.ScanWords) sc.Scan(); d, _ := strconv.Atoi(sc.Text()) sc.Scan(); s1 := sc.Text() sc.Scan(); s2 := sc.Text() s := s1 + s2 max_h := 0 for i := 0; i < len(s); i++ { var h = 0 var u = d for j := i; j < len(s); j++ { if c := s[j:j + 1]; c == "o" { h++ }else { if u > 0 { u-- h++ } else { break } } } if h > max_h { max_h = h } fmt.Println(i, h) } fmt.Println(max_h) }