#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;

const int M=998244353;

const int MAXL=600;
char str[305];
int f[305][305][605],g[305],sg[305],k,n,ans;

int main () {
	
	scanf ("%s%d",str,&k);
	for (int i=0,ii=strlen (str);i<ii;i++) {
		if (str[i]=='0') n++;
		else g[n]++;
	}
	for (int i=n;i>=0;i--) {
		sg[i]=sg[i+1]+g[i];
	}
	if (n==0) {puts ("1"); return 0;}
	for (int j=0;j<=g[n];j++) f[n][j][0]=1;
	for (int i=n-1;i>0;i--) {
		for (int j=0;j<=sg[i];j++) {
			for (int k=0;k<=j&&k<=g[i];k++) {
				for (int l=0;l<=sg[i];l++) {
					f[i][j][l]+=f[i+1][j-k][l];
					if (f[i][j][l]>=M) f[i][j][l]-=M;
				}
			}
			for (int k=g[i]+1;k<=j;k++) {
				for (int l=0;l<=sg[i]&&l<=MAXL;l++) {
					f[i][j][l+k-g[i]]+=f[i+1][j-k][l];
					if (f[i][j][l+k-g[i]]>=M) f[i][j][l+k-g[i]]-=M;
				}
			}
		}
	}
	for (int j=0;j<=sg[1];j++) {
		for (int l=0;l<=MAXL;l++) {
			int p=l+sg[1]-j;
			if (p>k) break;
			ans+=f[1][j][l];
			if (ans>=M) ans-=M;
		}
	}
	printf ("%d\n",ans);
	
	return 0;
}
