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.*;

// author : Multi-Thread

public class Main {
	static int INF = (int) 1e9 + 7;

	public static void main(String[] args) {
//		int test = fs.nextInt();
		int test = 1;
		for (int cases = 0; cases < test; cases++) {
			int k = fs.nextInt();
			char ar[] = fs.next().toCharArray();
			System.out.println(solve(k, ar));
		}

	}

	static long solve(int k, char[] ar) {
		int n = ar.length;
		if (k == 0) {
			long ans = 0;
			long c = 0;
			for (int i = 0; i < n - 1; i++) {
				if (ar[i] == ar[i + 1]) {
					if (ar[i] == '0') {
						++c;
					}
				} else {
					if (ar[i] == '0') {
						++c;
						ans += ((long) c * (c + 1)) / 2;
					}
					c = 0;
				}
			}
			if (ar[n - 1] == '1') {
				ans += ((long) c * (c + 1)) / 2;
			} else {
				++c;
				ans += ((long) c * (c + 1)) / 2;
			}
			return ans;
		}
		long startingZero = 0, firstOne = -1;
		long counter = 0;
		HashMap<Integer, Pair> hm = new HashMap<Integer, Pair>();
		for (int i = 0; i < n; i++) {
			if (ar[i] == '1') {
				if (hm.get(i) == null) {
					hm.put(i, new Pair(-1, -1));
				}
				hm.get(i).first = (int) (startingZero == 0 ? -1 : startingZero);
				startingZero = 0;
				continue;
			}
			++startingZero;
		}
		startingZero = 0;
		for (int i = n - 1; i >= 0; i--) {
			if (ar[i] == '1') {
				firstOne = i;
				hm.get(i).second = (int) (startingZero == 0 ? -1 : startingZero);
				startingZero = 0;
				continue;
			}
			++startingZero;
		}
		if (firstOne == -1)
			return 0;
		Set<Integer> set = hm.keySet();
		ArrayList<Integer> al = new ArrayList<Integer>();
		al.addAll(set);
		Collections.sort(al);
//		System.out.println(hm);
//		System.out.println(al);
		for (int i = k - 1; i < al.size(); i++) {
			int start = al.get(i - k + 1);
			int end = al.get(i);
//			System.out.println(start + " " + end);
//			System.out.print(hm.get(start) + " " + hm.get(end));
			if (hm.get(start).first == -1 && hm.get(end).second != -1) {
				counter += hm.get(end).second + 1;
			} else if (hm.get(start).first != -1 && hm.get(end).second == -1) {
				counter += hm.get(start).first + 1;
			} else if (hm.get(start).first != -1 && hm.get(end).second != -1) {
				counter += ((long) (hm.get(start).first + 1) * (long) (hm.get(end).second + 1));
			} else {
				++counter;
			}
//			System.out.println(" " + counter);
		}

//		if (hm.get(start).first == -1 && hm.get(end).second != -1) {
//			counter += hm.get(end).second + 1;
//		} else if (hm.get(start).first != -1 && hm.get(end).second == -1) {
//			counter += hm.get(end).first + 1;
//		} else if (hm.get(start).first != -1 && hm.get(end).second != -1) {
//			counter += (3 * (hm.get(start).first + 1) * (hm.get(end).second + 1));
//		}
		return counter;
	}

	static int power(int x, int y, int p) {
		int res = 1;
		x = x % p;
		if (x == 0)
			return 0;
		while (y > 0) {
			if ((y & 1) == 1)
				res = (res * x) % p;
			y = y >> 1;
			x = (x * x) % p;
		}
		return res;
	}

	static void intSort(int[] ar, boolean reverse) {
		ArrayList<Integer> al = new ArrayList<Integer>();
		for (int i : ar)
			al.add(i);
		Collections.sort(al);
		if (reverse) {
			for (int i = 0; i < ar.length; i++)
				ar[i] = al.get(ar.length - i - 1);
		} else {
			for (int i = 0; i < ar.length; i++)
				ar[i] = al.get(i);
		}
	}

	static void longSort(long[] ar, boolean reverse) {
		ArrayList<Long> al = new ArrayList<Long>();
		for (long i : ar)
			al.add(i);
		Collections.sort(al);
		if (reverse) {
			for (int i = 0; i < ar.length; i++)
				ar[i] = al.get(ar.length - i - 1);
		} else {
			for (int i = 0; i < ar.length; i++)
				ar[i] = al.get(i);
		}
	}

	static void sieve() {
		boolean prime[] = new boolean[101];
		Arrays.fill(prime, true);
		prime[1] = false;
		for (int i = 2; i * i <= prime.length - 1; i++) {
			for (int j = i * i; j <= prime.length - 1; j += i) {
				prime[j] = false;
			}
		}
	}

	public static int[] radixSort(int[] f) {
		return radixSort(f, f.length);
	}

	public static int[] radixSort(int[] f, int n) {
		int[] to = new int[n];
		{
			int[] b = new int[65537];
			for (int i = 0; i < n; i++)
				b[1 + (f[i] & 0xffff)]++;
			for (int i = 1; i <= 65536; i++)
				b[i] += b[i - 1];
			for (int i = 0; i < n; i++)
				to[b[f[i] & 0xffff]++] = f[i];
			int[] d = f;
			f = to;
			to = d;
		}
		{
			int[] b = new int[65537];
			for (int i = 0; i < n; i++)
				b[1 + (f[i] >>> 16)]++;
			for (int i = 1; i <= 65536; i++)
				b[i] += b[i - 1];
			for (int i = 0; i < n; i++)
				to[b[f[i] >>> 16]++] = f[i];
			int[] d = f;
			f = to;
			to = d;
		}
		return f;
	}

	static class Pair {
		int first, second;

		public Pair(int first, int second) {
			this.first = first;
			this.second = second;
		}

		public String toString() {
			return "[" + first + "," + second + "]";
		}
	}

	static class LongPair {
		long first;
		long second;

		LongPair(long a, long b) {
			this.first = a;
			this.second = b;
		}

		public String toString() {
			return "[" + first + "," + second + "]";
		}
	}

	static void primeFactors(int n) {
		while (n % 2 == 0) {
			System.out.print(2 + " ");
			n /= 2;
		}
		for (int i = 3; i <= Math.sqrt(n); i += 2) {
			while (n % i == 0) {
				System.out.print(i + " ");
				n /= i;
			}
		}
		if (n > 2)
			System.out.print(n);
	}

	static boolean isPrime(long n) {
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;
		if (n % 2 == 0 || n % 3 == 0)
			return false;
		long sq = (long) Math.sqrt(n);
		for (int i = 5; i <= sq; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

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

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

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]);
			}
		}

		public void println() {
			writer.print("\n");
		}

		public void printLine(Object... objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}

		public void flush() {
			writer.flush();
		}

	}

	private static final FastReader fs = new FastReader();
	private static final OutputWriter op = new OutputWriter(System.out);
}