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.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.StringTokenizer;

/**
 * 111118315581
 *
 * -3 3 2 3 2 3 2 3 -3 3 -3 3 -3 3 2 3
 *
 * @author pttrung
 */
public class C {

    //   public static long x, y, gcd;
    //   public static int Mod = 1000000007;
    public static long[] dp;

    public static void main(String[] args) {
        Scanner in = new Scanner();
        PrintWriter out = new PrintWriter(System.out);
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File("output.txt")));
        int n = in.nextInt();
        String line = in.next();
        if (n != 0) {

            ArrayList<Integer> list = new ArrayList();

            for (int i = 0; i < line.length(); i++) {
                if (line.charAt(i) == '1') {
                    list.add(i);
                }
            }
            long result = 0;
            for (int i = 0; i < list.size() - n + 1; i++) {
                int other = i + n - 1;
                int index = list.get(i);
                int end = list.get(other);
                long left, right;

                if (i == 0) {
                    left = index;
                } else {
                    int last = list.get(i - 1);
                    left = index - last - 1;
                }
                if (other + 1 < list.size()) {
                    int next = list.get(other + 1);
                    right = next - end - 1;
                } else {
                    right = line.length() - end - 1;
                }
                //  System.out.println(left + 1 );
                //  System.out.println(right);
                result += (left + 1);
                result += (left + 1) * right;
            }
            out.println(result);
        } else {
            long result = 0;
            int count = 0;
            for (int i = 0; i < line.length(); i++) {
                if (line.charAt(i) == '0') {
                    count++;
                } else {
                    result += factorial(count);
                    count = 0;
                }
            }
            if (count > 0) {
                result += factorial(count);
            }
            out.println(result);
        }
        out.close();
    }

    public static long factorial(int val) {
        long result = val;
        for(int i = 0; i < val; i++){
            result += i;
        }
        return result;
    }

//    public static long cal(int index, int maxIndex, int[] data) {
//        if (index == data.length) {
//            return 0;
//        }
//        if (dp[maxIndex][index] != -1) {
//            return dp[maxIndex][index];
//        }
//        long result = 0;
//        if (data[index] <= data[maxIndex]) {
//            long val = data[maxIndex] - data[index];
//            result += cal(index + 1, maxIndex, data);
//            result += val;
//        } else {
//            long a = data[index] - data[maxIndex];
//            a += cal(index + 1, maxIndex, data);
//            long b = cal(index + 1, index, data);
//            result = Math.min(a, b);
//        }
//        return dp[maxIndex][index] = result;
//    }
    public static long pow(long a, long b) {
        if (b == 0) {
            return 1;
        }
        long val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

    public static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

//    public static void extendEuclid(long a, long b) {
//        if (b == 0) {
//            x = 1;
//            y = 0;
//            gcd = a;
//            return;
//        }
//        extendEuclid(b, a % b);
//        long x1 = y;
//        long y1 = x - (a / b) * y;
//        x = x1;
//        y = y1;
//
//    }
    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //      br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("basketball_game.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}