A string is binary, if it consists only of characters "0" and "1".

String v is a substring of string w if it has a non-zero length and can be read starting from some position in string w. For example, string "010" has six substrings: "0", "1", "0", "01", "10", "010". Two substrings are considered different if their positions of occurrence are different. So, if some string occurs multiple times, we should consider it the number of times it occurs.

You are given a binary string s. Your task is to find the number of its substrings, containing exactly k characters "1".

Input

The first line contains the single integer k (0 ≤ k ≤ 106). The second line contains a non-empty binary string s. The length of s does not exceed 106 characters.

Output

Print the single number — the number of substrings of the given string, containing exactly k characters "1".

Please do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.

Examples

Input

1
1010


Output

6


Input

2
01010


Output

4


Input

100
01010


Output

0

Note

In the first sample the sought substrings are: "1", "1", "10", "01", "10", "010".

In the second sample the sought substrings are: "101", "0101", "1010", "01010".
import os
import sys
from io import BytesIO, IOBase
 
from types import GeneratorType
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        import os
        self.os = os
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            self.os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
 
import time
start_time = time.time()

import collections as col
from functools import reduce

def getInts():
    return [int(s) for s in input().split()]

def getInt():
    return int(input())

def getStrs():
    return [s for s in input().split()]

def getStr():
    return input()

def listStr():
    return list(input())



"""
Since the chars can only be one and zero, we can use sliding technique. Find how many start at index 0, then 1 etc

Start at zero, increase j until sum is k (j00), then increase it until sum is k+1(j01), and go back 1. Add j01-j00 to result.
While S[i] is 0, keep adding that many to the result, increasing i.
Once we hit i = 1, add that, then increase i once more.
From there, we must increase j again.
Repeat until j == N or i == N-1
"""

def solve():
    K = getInt()
    S = getStr()
    N = len(S)
    curr = int(S[0]=='1')
    i = 0
    j = 0
    ans = 0
    tmp_ans = 0
    while i < N and j < N:
        if S[i] == '1' and K == 0:
            i += 1
            j += 1
            continue
        start_i = i
        while curr < K and j+1 < N:
            j += 1
            curr += S[j]=='1'
        if curr < K:
            return ans
        start_j = j
        while j+1 < N and S[j+1] == '0':
            j += 1
        end_j = j
        while i+1 < N and S[i] == '0' and i+1 <= end_j:
            i += 1
        end_i = i
        ans += (end_i-start_i+1)*(end_j-start_j+1)
        if end_i > start_j:
            ans -= (end_i-start_j)*(end_i-start_j+1)//2
            #remove the pairs (i,j) where (i>j)
            # (0,1,2), (0,1,2) gives (0,0) (0,1), (0,2), (1,0), (1,1), (1,2), (2,0), (2,1), (2,0)
            # i goes from start_j+1 to end_i
            # j goes from start_j to i-1
            # sum i (start_j+1 to end_i) (i-start_j)
            # end_i*(end_i+1)//2 - (start_j)*(start_j)//2 -start_j*(end_i-start_j)
            # end_i = 7, start_j = 5, 28 - 15 - 10
        i += 1
        j += 1
        #otherwise j is now the end point of our search (may also be the start point)
        #now let's find all values of i for which j is this endpoint
            
    return ans
    
print(solve())

 
