Telephones

Add the fewest phones to empty desks so a ring hops from the first desk to the last with each hop spanning at most D.

Medium4GreedyArrayInterviewNo attempts yetTime limit1sMemory limit64 MB

Problem

A room holds NN desks in one row from left to right, each desk next to the following one. Some desks hold one telephone, and the rest are empty.

Every telephone is broken. The telephone on desk ii rings when the telephone on desk jj rings and jiD|j - i| \le D.

The first desk and the last desk always hold a telephone. At the start the leftmost telephone rings. To make the telephone on the last desk ring, you place new telephones on empty desks. Find the smallest number of new telephones.

Input

The first line contains two positive integers NN and DD (1N3000001 \le N \le 300000, 1DN1 \le D \le N).

The second line contains NN numbers separated by spaces, each of them 00 or 11. If the ii-th number is 11, the ii-th desk from the left holds a telephone. If it is 00, that desk is empty.

Output

Print the smallest number of new telephones on the first line.

Hint

In the test cases worth 4040 points in total, 1N201 \le N \le 20 holds.