package main import ( "fmt" ) func max(a, b int) int { if a > b { return a } else { return b } } func countMaxConsecutiveHolidays(cs []rune) int { p := 0 max := 0 for _, c := range cs { if c == 'o' { p++ if max > p { max = p } } else { p = 0 } } return max } func main() { var d int var a, b string fmt.Scanf("%d %s %s", &d, &a, &b) s := a + b ans := 0 for i := -d; i <= len(s); i++ { // i 日目から有給を取る m := make(map[int]int) for j := 0; j < len(s); j++ { m[j] = int(s[j]) } for j := i; j < i+d; j++ { if m[j] == 0 || m[j] == 'x' { m[j] = 'o' } else { break } } p := 0 // 連続休暇 for j := -d; j < len(s)+d; j++ { if m[j] == 'o' { p++ if p > ans { ans = p } } else { p = 0 } } } fmt.Println(ans) }