PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GD0000209. Giữ khoảng cách (Social Distance)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Giữ khoảng cách (Social Distance)

Social Distance

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

A restaurant has nn tables numbered 11 through nn along a straight line. A binary string ss records occupancy: 1 is occupied and 0 is empty.

Any two occupied table indices i,ji,j must satisfy ∣i−j∣>k|i-j|>k. The initial seating arrangement is guaranteed to satisfy this rule.

You may seat more people at currently empty tables without moving existing customers or violating the distance requirement. Find the maximum number of additional people who can be seated.

Input

  • The first line contains integers nn and kk, the number of tables and the forbidden distance.
  • The second line contains a binary string ss of length nn; the ii-th character describes table ii.

Output

Print a non-negative integer: the maximum number of empty tables that can be occupied while all occupied table pairs remain more than kk positions apart.

Subtasks

  • Subtask 1 (20 points): 1≤k≤n≤201\le k\le n\le20; s∈{0,1}ns\in\{0,1\}^n; any two original 1 positions differ by more than kk.
  • Subtask 2 (30 points): 1≤k≤n≤20001\le k\le n\le2000; s∈{0,1}ns\in\{0,1\}^n; any two original 1 positions differ by more than kk.
  • Subtask 3 (50 points): 1≤k≤n≤2⋅1051\le k\le n\le2\cdot10^5; s∈{0,1}ns\in\{0,1\}^n; any two original 1 positions differ by more than kk.

Examples

Input

6 1
100010

Output

1

Explanation

There are six tables with k=1k=1. Tables 1 and 5 are occupied. Tables 2 and 4 are adjacent to an occupied table and therefore forbidden, and table 6 is adjacent to table 5. Table 3 is two positions away from both tables 1 and 5, so exactly one additional person can sit there. Print 1.