/*
                                        //     //     //\\\\\\\\\
                                        \\    //      \\        \\
                                        //   //       //         \\
                                        \\  //        \\          \\
                                        // //         //           \\
                                        \\//          \\            \\       
                                        //\\          //            //
                                        \\ \\         \\           //
                                        //  \\        //          //
                                        \\   \\       \\         //
                                        //    \\      //        //
                                        \\     \\     \\/////////
*/

#include <bits/stdc++.h>
//#include <boost/math/common_factor.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
//using namespace boost::multiprecision;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define vint vector <int>
#define vll vector <long long int>
#define endl cout<<'\n'
#define fre(i,l,n) for(long long int i=l;i<n;++i)
#define fr(i,l,n) for(long long int i=l;i<=n;i++)
#define rfre(i,n,l) for(long long int i=n-1;i>=l;i--)
#define rfr(i,n,l) for(long long int i=n;i>=l;--i)
#define tab '\t'
#define debug cout<<'*';
#define s(a) cin>>a
#define p(a) cout<<a
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> pii;
typedef pair<long long int,long long int> pll;
typedef pair<int,pair<int,int> > tii;
typedef vector<int> vec;
typedef vector<long long> vecll;
typedef vector<pair<int,int> > vec_pii;
typedef vector<pair<long long int,long long int> > vec_pll;
typedef vector<vector<int> > vvi;
typedef vector<vector<ll> > vvll;
typedef vector<vector<pair<int,int> > > vvpii;
typedef vector<vector<pair<ll,ll> > > vvpll;
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define mod 1000000007
#define Pi 3.14159265358979
#define gcd(a,b) __gcd(a,b)
#define sf(n) scanf("%lld",&(n))
#define pf(n) printf("%lld\n",(n))
#define min3(a,b,c) (min((c),min((a),(b))))
#define max3(a,b,c) (max((a),max((b),(c))))
#define w(t) while(t--)
#define flt(a) cout<<fixed<<setprecision(a)
#define cntSetBits(n) __builtin_popcountll(n)
/*****************************
*****************************/

#define modi 998244353





void solve()
{
    string str;
    s(str);
    ll k;
    s(k);
    ll n = (ll)str.length();
    k = min(n,k);
    ll cnt = 0;
    vecll kd;
    kd.pb(cnt);
    fre(i,0,n)
    {
        if(str[i] == '0')
        {
            kd.pb(cnt);
        }
        else
        {
            cnt += 1;
        }
    }
    ll sz = (ll)kd.size();
    sz -= 1;
    ll dp[2][305][305];
    dp[0][0][0] = 1;
    ll ans = 0;
    fr(i,1,sz)
    {
        ll flag = (i & 1);
        memset(dp[flag],0,sizeof(dp[flag]));
        fr(j,0,n-sz-kd[i])
        {
            fr(pm,0,n)
            {
                fr(sks,0,j)
                {
                    dp[flag][j][pm] = (dp[flag][j][pm]%modi + dp[(flag ^ 1)][sks][pm]%modi)%modi;
                }
                fr(sks,j+1,min({j+(kd[i]-kd[i-1]),n,pm+j}))
                {
                    dp[flag][j][pm] = (dp[flag][j][pm]%modi + dp[(flag ^ 1)][sks][pm-(sks-j)]%modi)%modi;    
                }
            }
        }
    }
    fr(i,0,n-sz)
    {
        fr(j,0,k)
        {
            if(i+j <= k)
            {
                ans = (ans%modi + dp[sz & 1][i][j]%modi)%modi;
            }
        }
    }
    p(ans);endl;
}



int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    ll t=1;
    // s(t);
    w(t)
    {
        solve();
    }
    return 0;
}









Measured memory_bytes: 5092