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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

const ll MOD = 998244353;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	string s; cin >> s;
	ll k; cin >> k;
	
	vl a;
	ll cur = 0;
	for (char c: s) {
		if (c == '0') a.pb(cur), cur = 0;
		else cur++;
	}
	a.pb(cur);
	reverse(all(a));

	ll sum = 0;
	vvl dp = {{1}}; // dp[given][rem], 0 <= rem <= given <= sum

	for (ll x: a) {
		ll nsum = min(sum+x,k);
		vvl ndp(nsum+1, vl(2*nsum+1));

		FOR(given,0,sum+1) FOR(rem,0,given+1) if (dp[given][rem]) {
			FOR(here,-rem,x+1) {
				ll ngiven = given + max(here,0LL);
				if (ngiven > k) continue;
				ll nrem = rem + here;
				ndp[ngiven][nrem] += dp[given][rem];
			}
		}

		dp = ndp, sum = nsum;

		FOR(given,0,sum+1) FOR(rem,0,given+1) dp[given][rem] %= MOD;
	}
	
	ll res = 0;
	FOR(given,0,sum+1) res += dp[given][0];
	res %= MOD;
	cout << res << endl;
}

