#include <bits/stdc++.h>

using namespace std;

const int MX = 301, md = 998244353;

char str[MX];
int a[MX], s[MX], f[MX][MX], g[MX][2 * MX], h[MX + 1][2 * MX];

int main() {
	int k;
	ignore = scanf("%s %d", str, &k);
	
	k = min(k, MX - 1);
	
	int n = 0;
	for (int i = 0, c = 0; true; i++) {
		if (str[i] == '1') c++;
		else {
			a[n++] = c;
			c = 0;
			
			if (str[i] == 0) break;
		}
	}
	
	s[0] = 0;
	for (int i = 0; i < n; i++) s[i + 1] = s[i] + a[i];
	
	f[0][0] = 1;
	for (int p = 0; p < n; p++) {
		memset(g, 0, sizeof g);
		memset(h, 0, sizeof h);
		
		for (int x = 0; x <= k; x++)
			for (int y = s[p]; y < MX; y++) {
				g[x][y] += f[x][y];
				g[x][y] %= md;
				
				g[x][y + a[p]] += md - f[x][y];
				g[x][y + a[p]] %= md;
				
				h[x][y + a[p]] += f[x][y];
				h[x][y + a[p]] %= md;
			}
		
		for (int x = 0; x < MX; x++)
			for (int y = 0; y < MX; y++) {
				f[x][y] = (g[x][y] + h[x][y]) % md;
				
				g[x][y + 1] += g[x][y];
				g[x][y + 1] %= md;
				
				h[x + 1][y + 1] += h[x][y];
				h[x + 1][y + 1] %= md;
			}
	}
	
	int ans = 0;
	for (int x = 0; x <= k; x++) {
		ans += f[x][s[n]];
		ans %= md;
	}
	
	printf("%d\n", ans);
	
	return 0;
}
