Seems to accept incorrect answers

Describe your issue

For input

18
111100111010100001

the system appears to accept 14 as a correct answer, because it apparently expects you to count the number of 1s and add the length of the longest substring of only 0s. But in my understanding of the description, the correct answer here would be 9: you flip the first two 0s and then have nine 1s in the beginning of the input.
Am I misunderstanding the instructions?