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 java.io.*;
import java.util.*;

public class AnotherProblemOnStrings {

    public static InputReader in;
    public static PrintWriter out;
    public static final int MOD = (int)1e9 + 7;
    public static void main(String[] args) {
        in = new InputReader(System.in);
        out = new PrintWriter(System.out);
        
        int k = in.nextInt();
        char[] str = in.readString().toCharArray();
        int n = str.length;
        ArrayList<Integer> ones = new ArrayList<Integer>();
        for (int i = 0; i < n; i++) {
            if(str[i] == '1')
                ones.add(i);
        }
        
        if(ones.size() < k) {
            out.println(0);
            out.close();
            return;
        }
        if(k == 0) {
            long ans = 0;
            int prev = -1;
            for(int i = 0; i < ones.size(); i++) {
                int x = ones.get(i) - prev - 1;
                ans += (x*1L*(x + 1))/2;
                prev = ones.get(i);
            }
            int x = n - prev - 1;
            ans += (x*1L*(x + 1))/2;
            out.println(ans);
            out.close();
            return;
        }
        
        int start = 0,
                end = k - 1;
        long result = 0;
        for (; end < ones.size(); start++, end++) {
            int next = (end + 1 < ones.size())? ones.get(end + 1) : n;
            int prev = (start - 1 >= 0)? ones.get(start - 1) : -1;
            result += (next - ones.get(end))*1L*(ones.get(start) - prev);
        }
        out.println(result);
        
        out.close();
    }
    
    
    public static long pow(int base, long exp) {
        if(exp == 0)
            return 1;
        if(exp == 1)
            return base;
        long val = pow(base, exp/2);
        long result = (val*val)%MOD;
        if((exp&1) == 1)
            result = (result*base)%MOD;
        return result;
    }
    
    public static long modInverse(int a) {
        return pow(a, MOD-2)%MOD;
    }
    
    static class Nodex implements Comparable<Nodex>{
        int x, y;
        
        public Nodex (int x, int y) {
            this.x = x;
            this.y = y;
        }
        
        public void print() {
            System.out.println(x + " " + y + " ");
        }
        
        public int compareTo(Nodex that) {
           return Integer.compare(this.x, that.x);
        }
    }
    
    static class Nodey implements Comparable<Nodey>{
        int x, y;
        
        public Nodey (int x, int y) {
            this.x = x;
            this.y = y;
        }
        
        public void print() {
            System.out.println(x + " " + y + " ");
        }
        
        public int compareTo(Nodey that) {
           return Integer.compare(this.y, that.y);
        }
    }
    
    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}