3054

Problem ID: 3054

The official OBI's solution is wrong. So this AC solution is intentionally wrong too.

For the following input
2 7
1 1 1 1 1 0 1
1 0 1 1 1 1 1
the correct answer is 6, not 7.