$k$-Even-Sum Sequence

No attempts yetTime limit1sMemory limit256 MB

Problem

You are given an integer sequence a1,a2,,ana_1, a_2, \ldots, a_n. For every integer ii with 1ink+11 \le i \le n - k + 1, if the partial sum ai+ai+1++ai+k1a_i + a_{i+1} + \cdots + a_{i+k-1} is even, the sequence is called a kk-even-sum sequence.

In other words, the sum of every contiguous block of length kk must be even.

You may choose some elements of the sequence and change each of them to any integer you like. Find the minimum number of elements you must change to turn the sequence into a kk-even-sum sequence.

Input

The first line contains two integers nn and kk separated by a space. (1kn1061 \le k \le n \le 10^6)

The second line contains nn integers separated by spaces; the ii-th of them is aia_i. (0ai1090 \le a_i \le 10^9)

Output

Print the minimum number of elements that must be changed on a single line.