#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int n ; cin>>n;
	int k ; cin>>k;
	string s;
	cin>>s;
		
	
	int ans = 0 ; 
	for(int i = 0 ; i<n;i++){
		int count = 0 ; 
		for(int j = i ; j<n;j++){
			if(s[j]=='5'){
				count++;
				
			}
			if(count==k) ans++;
		}
		
	}
	cout<<ans;
	return 0;
}