#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll n,k,kq = 0,t = 0,l,h,m,a[100005],vt = 0;
string s;
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    freopen("XAUCON.inp", "r", stdin);
    freopen("XAUCON.out", "w", stdout);
    cin >> n >> k;
    cin >> s;
    for(int i = 1; i <= n; i++)
    {
        a[i] = a[i-1] + (int)(s[i-1]);
    }
    for(int i = 1; i <= n; i++)
    {
        l = i, h = n,vt = i-1;
        while(l <= h)
        {
            m = (l+h)>>1;
            if(a[m] - a[i-1] >= k)
            {
                h = m - 1;
                vt = m;
            }
            else l = m + 1;
        }
        if(vt != i-1)
            kq += n - vt + 1;
    }
    cout << kq;
}
