#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
    string S;
    int K;
    cin>>S>>K;

    vector<int> A(1);
    for (char x: S)
        if (x=='0')
            A.push_back(0);
        else
            A.back()++;

    int n = (int)A.size();
    int n1 = 0;
    for (char x: S)
        if (x=='1')
            n1++;
    K = min(K, n1);

    long long M = 998244353;
    vector<vector<long long>> T(K+1, vector<long long>(n1+1));
    T[0][0] = 1;
    for (int i=n-1; i>=0; i--)
    {
        vector<vector<long long>> P(K+1, vector<long long>(n1+1));
        P.swap(T);
        for (int j=0; j<=K; j++)
            for (int k=0; k<=K; k++)
                //if (P[j][k]>0)
                    for (int l=0; l<=n1; l++)
                    {
                        int j2 = j+max(A[i]-l, 0);
                        int k2 = k+A[i]-l;
                        if (j2<=K && 0<=k2)
                        {
                            T[j2][k2] += P[j][k];
                            T[j2][k2] %= M;
                        }
                    }
    }
    long long ans = 0;
    for (int i=0; i<=K; i++)
        ans += T[i][0];
    cout<<ans%M<<endl;
}
