#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll N=3e2+5;
const ll p=998244353;

ll read()
{
	ll s=0;
	char c=getchar(),lc='+';
	while (c<'0'||'9'<c) lc=c,c=getchar();
	while ('0'<=c&&c<='9') s=s*10+c-'0',c=getchar();
	return lc=='-'?-s:s;
}
void write(ll x)
{
	if (x<0)
	{
		putchar('-');
		x=-x;
	}
	if (x<10) putchar(x+'0');
	else
	{
		write(x/10);
		putchar(x%10+'0');
	}
}
void print(ll x,char c='\n')
{
	write(x);
	putchar(c);
}
ll dp[N][N][N],a[N],sum[N];
char s[N];

int main()
{
	
	memset(dp,0,sizeof(dp));
	memset(sum,0,sizeof(sum));
	scanf("%s",s+1);
	ll n=strlen(s+1),m=min(n,read()),cnt=1;
	for (ll i=1;i<=n;i++)
	if (s[i]=='1') a[cnt]++;
			  else cnt++;
	sum[0]=0;
	for (ll i=1;i<=cnt;i++) sum[i]=sum[i-1]+a[i];
	dp[0][0][0]=1;
	for (ll i=1;i<=cnt;i++)//前i个 
	for (ll j=sum[i];j<=sum[cnt];j++)//和为j 
	for (ll k=0;k<=m;k++)//共操作k次 
	for (ll l=0;l<=j;l++)//第i位填l 
	if (k>=max(l-a[i],0ll)) dp[i][j][k]=(dp[i][j][k]+dp[i-1][j-l][k-max(l-a[i],0ll)])%p;
	ll ans=0;
	for (ll i=0;i<=m;i++) ans=(ans+dp[cnt][sum[cnt]][i])%p;
	print(ans);

	return 0;
}