#d2502. 01序列

01序列

01 Sequence

Problem Description

We call a string a good string if it contains only the characters 0 and 1.

Given a good string, find how many of its substrings contain exactly kk occurrences of 1.

Input Format

The first line gives an integer kk, the required number of 1s in a substring.

The second line gives the good string.

Output Format

Output one integer, the number of qualifying substrings in the good string.

Sample Input 1

1
1010

Sample Output 1

6

Sample Input 2

2
01010

Sample Output 2

4

Constraints

0≤k≤106, ∣s∣≤1060\le k \le 10^6,\ |s|\le 10^6