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".

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.lang.Comparable;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Tibor
 */
public class test {

//    static BufferedReader bin;
//    static StreamTokenizer in = new StreamTokenizer(bin = new BufferedReader(
//            new InputStreamReader(System.in)));
//    static PrintWriter out = new PrintWriter(System.out);
//
//    static {
//        in.ordinaryChars('-', '-');
//        in.ordinaryChars('+', '+');
//        in.wordChars('-', '-');
//        in.wordChars('+', '+');
//        in.wordChars('.', '.');
//    }
//
//    static int nextInt() {
//        try {
//            in.nextToken();
//        } catch (IOException ex) {
//            Logger.getLogger(test.class.getName()).log(Level.SEVERE, null, ex);
//        }
//        return (int) in.nval;
//    }
//
//    static String nextString() {
//        try {
//            in.nextToken();
//        } catch (IOException ex) {
//            Logger.getLogger(test.class.getName()).log(Level.SEVERE, null, ex);
//        }
//        return in.sval;
//    }
    static InputStreamReader converter = new InputStreamReader(System.in);
    static BufferedReader in = new BufferedReader(converter);

    public static String readLine() {
        String s = "";
        try {

            s = in.readLine();
        } catch (Exception e) {
            System.out.println("Error! Exception: " + e);
        }
        return s;
    }
    public static void main(String args[]) throws Exception {
        k = Integer.parseInt(readLine());
        String s = readLine();
        char[] c = s.toCharArray();
        int drb = 0;
        for (char c2 : c) {
            if (c2 == '1') {
                drb++;
            }
        }
        ch = new int[drb + 1];
        int ind = 0;
        drb = 0;
        for (char c2 : c) {
            if (c2 == '1') {
                ch[ind] = drb + 1;
                drb = 0;
                ind++;
            } else {
                drb++;
            }
        }
        ch[ind] = drb + 1;
        
        long osz = 0;
        for (int i = 1; i <= ch.length - k; i++) {
            if(k>0)
            osz+=(long)ch[i-1]*(long)ch[i-1+k];
            else 
               osz+=(long)(ch[i-1])*(long)(ch[i-1+k]-1)/2;
//            megn m = new megn();
//            m.hon = i;
//            TreeSet<megn> lm = e.get(m);
//            if (lm == null) {
//
//                lm = new TreeSet<megn>(new Comparator<megn>() {
//
//                    @Override
//                    public int compare(megn o1, megn o2) {
//                        if (ch[o1.hon - 1] != ch[o2.hon - 1]) {
//                            return ch[o1.hon - 1] > ch[o2.hon - 1] ? -1 : 1;
//                        }
//                        if (ch[o1.hon - 1 + k] != ch[o2.hon - 1 + k]) {
//                            return ch[o1.hon - 1 + k] > ch[o2.hon - 1 + k] ? -1 : 1;
//                        }
//                        return 0;
//                    }
//                });
//            }
//            e.put(m, lm);
//            m.add(lm);
        }

//        for (megn d : e.keySet()) {
//            TreeSet<megn> lm = e.get(d);
//            osz += megn.szamol(lm);
//        }
        System.out.println();
        System.out.print(osz);
    }
    static int k;
    static int[] ch;
    static TreeMap<megn, TreeSet<megn>> e = new TreeMap<megn, TreeSet<megn>>();

    static class megn implements Comparable<megn> {

        int hon;

        public void add(TreeSet<megn> lm) {
//            LinkedList<megn> rem = new LinkedList<megn>();
//            for (megn m : lm) {
//                if (ch[hon - 1] <= ch[m.hon - 1] && ch[hon + k - 1] <= ch[m.hon + k - 1]) {
//                    return;
//                }
//                if (ch[hon - 1] >= ch[m.hon - 1] && ch[hon + k - 1] >= ch[m.hon + k - 1]) {
//                    rem.add(m);
//                }
//            }
//            lm.removeAll(rem);
            lm.add(this);
        }

        public static int szamol(TreeSet<megn> lm) {
            int ret = 0;
            megn el = null;
            for (megn m : lm) {
//                if (el == null) {
                    ret += ch[m.hon - 1] * ch[m.hon - 1 + k];
//                } else {
//                    ret += (ch[m.hon - 1]) * (ch[m.hon - 1 + k] - ch[el.hon - 1 + k]);
//                }
                el = m;
            }
            return ret;
        }

        @Override
        public int compareTo(megn o) {
            for (int i = 0; i < k - 1; i++) {
                if (ch[hon + i] != ch[o.hon + i]) {
                    return ch[hon + i] != ch[o.hon + i] ? -1 : 1;
                }
            }
            return 0;
        }
    }
}