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

#define ff first
#define ss second
#define PI acos(-1)
#define pb push_back
#define int long long
#define ld long double
#define sp fixed<<setprecision
#define bp __builtin_popcountll
#define all(x) x.begin(),x.end()
#define pii pair<long long,long long>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

const int M = 998244353;
const int N = 305;

int n,m,k;
vector<int> v,u;
vector<vector<int>> ans;
int dp[N][N][N];

int rec(int id,int carry,int can)
{
    if(id == -1)
    {
        //if(!carry){ans.pb(u);}
        return (carry == 0);
    }
    if(dp[id][carry][can] != -1)return dp[id][carry][can];
    int has = v[id] + carry;
    int ans = 0;
    for(int give=0;give<=min(has,k);give++)
    {
        int left = has - give;
        //u[id] = left;
        int now = max(0LL,left-v[id]);
        if(now > can)break;
        ans += rec(id-1,give,can-now),ans %= M;
    }
    dp[id][carry][can] = ans;
    return ans;
}

signed main()
{
    FAST
    int tc=1;
    //cin>>tc;
    for(int ti=1;ti<=tc;ti++)
    {
        for(int i=0;i<N;i++)for(int j=0;j<N;j++)for(int ii=0;ii<N;ii++)dp[i][j][ii]=-1;
        string s;
        cin>>s>>k;
        n = s.length();
        k = min(n,k);
        int curr = 0;
        for(int i=0;i<n;i++)
        {
            if(s[i] == '0')
            {
                v.pb(curr);
                curr = 0;
            }
            else curr++;
        }
        if(curr)v.pb(curr);
        m = v.size();
        //u = v;
        cout<<rec(m-1,0,k)<<endl;
        //sort(all(ans));
        //for(auto u:ans){for(auto i:u)cout<<i<<" ";cout<<endl;}
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int N_MAX = 302;

const int MOD = 998244353;

int n, k;

string s;

int m;

int a[N_MAX];
int spa[N_MAX];

int dp[N_MAX][N_MAX][N_MAX];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> s >> k;
    n = s.size();
    s = " " + s;
    for(int i = 1; i <= n; i++)
        if(s[i] == '1')
            a[i - (++m) + 1]++;
    for(int i = 1; i <= n; i++)
        spa[i] = spa[i - 1] + a[i];
    k = min(k, n);
    dp[0][0][0] = 1;
    for(int i = 1; i <= n; i++)
        for(int sp = spa[i]; sp <= spa[n]; sp++)
            for(int sum = 0; sum <= k; sum++)
            {
                for(int x = 1; x <= sum && (a[i] - x) <= sp && x <= a[i]; x++)
                {
                    dp[i][sp][sum] += dp[i - 1][sp - (a[i] - x)][sum - x];
                    if(dp[i][sp][sum] >= MOD)
                        dp[i][sp][sum] -= MOD;
                }
                for(int x = 0; (a[i] + x) <= sp; x++)
                {
                    dp[i][sp][sum] += dp[i - 1][sp - (a[i] + x)][sum];
                    if(dp[i][sp][sum] >= MOD)
                        dp[i][sp][sum] -= MOD;
                }
            }
    int ans = 0;
    for(int i = 0; i <= k; i++)
    {
        ans += dp[n][spa[n]][i];
        if(ans >= MOD)
            ans -= MOD;
    }
    cout << ans << "\n";
    return 0;
}
