#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i = (a); i < (b); ++i)
#define rrep(i,a,b) for(int i = (b); i --> (a);)
#define all(v) (v).begin(),(v).end()
#define trav(x,v) for(auto &x : v)
#define sz(v) int(v.size())
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;

const ll md = 998244353;

ll mem[301][301][301] = {};

int main(){
	cin.sync_with_stdio(0);
	cin.tie(0);
	cin.exceptions(cin.failbit);

	string s;
	int k;
	cin >> s >> k;
	s.push_back('0');
	k = min(k, 300);

	vi ls;
	for(int i = 0, cnt = 0; i < sz(s); ++i){
		if(s[i] == '0'){
			ls.push_back(cnt);
			cnt = 0;
		} else ++cnt;
	}
	while(!ls.empty() && ls.back() == 0) ls.pop_back();

	mem[0][0][k] = 1;

	rep(i,0,sz(ls)){
		rep(t,0,301) rep(c,0,k+1){
			ll cur = mem[i][t][c];
			cur %= md;
			mem[i+1][t][c] += cur; // neutral
			rep(x,1,c+1) if(t+x <= 300) mem[i+1][t + x][c - x] += cur; // get stuff
			rep(x,1,1+min(ls[i], t)) mem[i+1][t-x][c] += cur; // give stuff
		}
	}

	ll ans = 0;
	rep(c,0,k+1) ans += mem[sz(ls)][0][c];
	ans %= md;
	if(ans < 0) ans += md;
	cout << ans << endl;
}
