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

public class P165C {

  int k = 0;
  int [] ones = null;

  int ones(int lo, int hi) {
    return (ones[hi] - ((lo > 0) ? ones[lo - 1] : 0));
  }

  int findHi(int idx) {
    int hi = ones.length - 1;
    int lo = idx;

    while ((hi - lo) > 1) {
      int mid = (hi + lo) >>> 1;
      if (ones(idx, mid) <= k) {
        lo = mid;
      } else if (ones(idx, mid) > k) {
        hi = mid;
      }
    }

    return ((ones(idx, hi) == k) ? hi : ((ones(idx, lo) == k) ? lo : -1));
  }

  int findLo(int idx) {
    int hi = ones.length - 1;
    int lo = idx;

    while ((hi - lo) > 1) {
      int mid = (hi + lo) >>> 1;
      if (ones(idx, mid) < k) {
        lo = mid;
      } else if (ones(idx, mid) >= k) {
        hi = mid;
      }
    }

    return ((ones(idx, lo) == k) ? lo : ((ones(idx, hi) == k) ? hi : -1));
  }

  int [] find(int idx) {
    int hi = findHi(idx);
    int lo = findLo(idx);
    return ((hi != -1) ? (new int [] {lo, hi}) : null);
  }

  @SuppressWarnings("unchecked")
  public void run() throws Exception {
    k = nextInt();
    String s = next();
    ones = new int [s.length()];
    for (int i = 0; i < s.length(); i++) {
      ones[i] = ((i == 0) ? 0 : ones[i - 1]) + (s.charAt(i) - '0');
    }

    long count = 0;
    for (int i = 0; i < ones.length; i++) {
      int [] lh = find(i);
      count += (lh != null) ? (lh[1] - lh[0] + 1) : 0;
    }

    println(count);
  }

  public static void main(String... args) throws Exception {
    br = new BufferedReader(new InputStreamReader(System.in));
    pw = new PrintWriter(new BufferedOutputStream(System.out));
    new P165C().run();
    br.close();
    pw.close();
  }

  static BufferedReader br;
  static PrintWriter pw;
  StringTokenizer stok;

  String nextToken() throws IOException {
    while (stok == null || !stok.hasMoreTokens()) {
      String s = br.readLine();
      if (s == null) { return null; }
      stok = new StringTokenizer(s);
    }
    return stok.nextToken();
  }

  void print(byte b) { print("" + b); }
  void print(int i) { print("" + i); }
  void print(long l) { print("" + l); }
  void print(double d) { print("" + d); }
  void print(char c) { print("" + c); }
  void print(Object o) {
    if (o instanceof int[]) { print(Arrays.toString((int [])o));
    } else if (o instanceof long[]) { print(Arrays.toString((long [])o));
    } else if (o instanceof char[]) { print(Arrays.toString((char [])o));
    } else if (o instanceof byte[]) { print(Arrays.toString((byte [])o));
    } else if (o instanceof short[]) { print(Arrays.toString((short [])o));
    } else if (o instanceof boolean[]) { print(Arrays.toString((boolean [])o));
    } else if (o instanceof float[]) { print(Arrays.toString((float [])o));
    } else if (o instanceof double[]) { print(Arrays.toString((double [])o));
    } else if (o instanceof Object[]) { print(Arrays.toString((Object [])o));
    } else { print("" + o); }
  }
  void print(String s) { pw.print(s); }
  void println() { println(""); }
  void println(byte b) { println("" + b); }
  void println(int i) { println("" + i); }
  void println(long l) { println("" + l); }
  void println(double d) { println("" + d); }
  void println(char c) { println("" + c); }
  void println(Object o) { print(o); println(); }
  void println(String s) { pw.println(s); }
  int nextInt() throws IOException { return Integer.parseInt(nextToken()); }
  long nextLong() throws IOException { return Long.parseLong(nextToken()); }
  double nextDouble() throws IOException { return Double.parseDouble(nextToken()); }
  char nextChar() throws IOException { return (char) (br.read()); }
  String next() throws IOException { return nextToken(); }
  String nextLine() throws IOException { return br.readLine(); }
  int [] readInt(int size) throws IOException {
    int [] array = new int [size];
    for (int i = 0; i < size; i++) { array[i] = nextInt(); }
    return array;
  }
  long [] readLong(int size) throws IOException {
    long [] array = new long [size];
    for (int i = 0; i < size; i++) { array[i] = nextLong(); }
    return array;
  }
  double [] readDouble(int size) throws IOException {
    double [] array = new double [size];
    for (int i = 0; i < size; i++) { array[i] = nextDouble(); }
    return array;
  }
  String [] readLines(int size) throws IOException {
    String [] array = new String [size];
    for (int i = 0; i < size; i++) { array[i] = nextLine(); }
    return array;
  }
}