#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>  
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>
#include <fstream>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<vector<ll> > vv64;
typedef vector<vector<p64> > vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 998244353;
double eps = 1e-12;
#define forn(i,e) for(ll i = 0; i < e; i++)
#define forsn(i,s,e) for(ll i = s; i < e; i++)
#define rforn(i,s) for(ll i = s; i >= 0; i--)
#define rforsn(i,s,e) for(ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 2e18
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
 
ll mpow(ll a, ll b){
	if(a==0) return 0;
	if(b==0) return 1;
	ll t1 = mpow(a,b/2);
	t1 *= t1;
	t1 %= MOD;
	if(b%2) t1 *= a;
	t1 %= MOD;
	return t1;
}
 
ll mpow(ll a, ll b, ll p){
	if(a==0) return 0;
	if(b==0) return 1;
	ll t1 = mpow(a,b/2,p);
	t1 *= t1;
	t1 %= p;
	if(b%2) t1 *= a;
	t1 %= p;
	return t1;
}
 
ll modinverse(ll a, ll m){
	ll m0 = m; 
    ll y = 0, x = 1; 
    if (m == 1) return 0; 
    while (a > 1){
        ll q = a / m; 
        ll t = m; 
        m = a % m, a = t; 
        t = y; 
        y = x - q * y; 
        x = t; 
    }
    if (x < 0) x += m0; 
    return x; 
}

mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
 
ll range(ll l, ll r){
	return l + mt()%(r-l+1);
}
 
ll rev(ll v){
	return mpow(v,MOD-2);
}

const int N = 301;
ll dp[N][N][N];
ll suf[N][N];
ll pr[N][N];

void solve(){
	string s;
	cin >> s;
	ll k;
	cin >> k;
	ll n = sz(s);
	v64 vec;
	ll n1=0,n0=0;
	ll c = 0;
	forn(i,n){
		if(s[i]=='0') {
			vec.pb(c),c=0;
			n0++;
		}
		else {
			c++;
			n1++;
		}
	}
	k = min(k,n1);
	vec.pb(c);
	dp[0][0][0]=1;
	suf[0][0]=1;
	forn(j,n1+1) pr[j][0]=1; 
	forn(i,n0+1){
		forn(j,n1+1){
			forsn(l,j,k+1){
				ll v = vec[i];
				ll ju = j+v+1;
				ll jl = j-(n1-v)-1;
				dp[i+1][j][l] = suf[j][l] - (ju>n1 ? 0 : suf[ju][l]) + pr[j][l-j] - (jl<0 ? 0 : pr[jl][l-j]) - dp[i][j][l] + 3*MOD;
				ll c = dp[i+1][j][l]/MOD;
				dp[i+1][j][l]-=c*MOD;
				// if(i==0) cout << v << " " << ju << " " << jl << ln;
				// if(i==0) cout << suf[j][l] << " " << suf[ju][l] << " " << pr[j][l-j] << " " << dp[i][j][l];
				// cout << i << " " << j << " " << l << " " << dp[i+1][j][l] << ln;
			}
		}
		forn(l,k+1){
			ll cur = 0;
			rforn(j,n1){
				cur += dp[i+1][j][l];
				if(cur>=MOD) cur-=MOD;
				suf[j][l] = cur;
			}
		}
		forn(l,k+1){
			ll cur = 0;
			forn(j,n1+1){
				if(j+l > k) break;
				cur += dp[i+1][j][j+l];
				if(cur>=MOD) cur-=MOD;
				pr[j][l] = cur;
			}
		}
	}
	// cout << n0 << ln;
	ll ans = 0;
	forn(i,k+1){
		// cout << n0 << " " << i << " " << dp[n0][0][i] << ln;
		ans += dp[n0+1][0][i];
		ans %= MOD;
	}
	cout << ans << ln;
}
 
int main()
{
	fast_cin();
    ll t=1;
    // cin >> t;
    forn(i,t) {
    	// cout << "Case #" << i+1 << ": ";
    	solve();
    }
    return 0;
}

Measured memory_bytes: 57928