#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

const int INF = 1e9 + 7, N = 303, M = 998244353;

int dp[N][N][N];

void add(int &a, int b) {
	a += b;
	if(a >= M) a -= M;
}

signed main()
{
	IO_OP;
	
	string s;
	int k;
	cin >> s >> k;
	k = min(k, (int)s.size());
	vi v;
	int cnt = 0;
	for(char c:s) {
		if(c == '0') {
			v.PB(cnt);
			cnt = 0;
		} else {
			cnt++;
		}
	}
	v.PB(cnt);
	for(int i = 0; i < v.size(); i++) {
		for(int j = 0; j <= k; j++) {
			for(int l = 0; l + j <= k; l++) {
				if(i == 0) {
					if(j == 0) dp[i][j][l] = 1;
				} else {
					// take
					for(int take = 0; take <= v[i] && take <= j; take++) {
						add(dp[i][j][l], dp[i-1][j-take][l + take]);
					}					
					// put
					for(int put = 1; put <= l; put++) {
						add(dp[i][j][l], dp[i-1][j][l - put]);
					}
				}
			}
		}
	}
	int ans = 0;
	for(int i = 0; i <= k; i++)
		add(ans, dp[v.size() - 1][i][0]);
	cout << ans << endl;
}



