#include<bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define eb emplace_back
#define all(a) (a).begin(),(a).end()
#define SZ(a) (int)(a).size()
#define FOR(i, a, b) for(int i=(a); i<=(b); ++i)
#define iFOR(i, a, b) for(int i=(a); i>=(b); --i)
#define make_unique(a) sort(all((a))), (a).resize(unique(all((a)))-(a).begin())

using namespace std;

typedef pair<int,int> PII;
typedef long long LL;
typedef double DD;
typedef long double LD;
typedef pair<LL,LL> PLL;
typedef pair<DD,DD> PDD;
typedef vector<int> VI;
typedef vector<LL> VL;

const int N = 303;
const int mod = 998244353;
int mul(int a, int b){
    return a * 1ll * b % mod;
}
int add(int a, int b){
    int c = a+b;
    if(c < mod) return c;
    return c-mod;
}
int dp[2][N][N],sum[N][N]; 
char s[N];
int p[N];
int cvt(int a){
    return (a&1);
}
void play(int i, int len, int l){
    // generate quicksum
    memset(sum, 0, sizeof sum);
    FOR(j, 0, len){
        FOR(k, 0, l){
            sum[j][k] = dp[i][j][k];
            if(j>0 && k>0) sum[j][k] = add(sum[j][k], sum[j-1][k-1]);
        }
    }
    // generate quicksum on dp
    FOR(k, 0, l){
        iFOR(j, len-1, 0){
            dp[i][j][k] = add(dp[i][j+1][k], dp[i][j][k]);
        }
    }
}
int main(){
    int n = 0, l;
    scanf("%s %d",s+1,&l);
    int len = strlen(s+1);
    FOR(i, 1, len) if(s[i]=='0'){
        ++n; p[n] = i;
    }
    // IMPORTANT
    // n is length of p
    // len is length of entire string
    if(n == 0 || n == len){
        printf("1"); return 0;
    }
    
//printf("%d\n",n);
//FOR(i, 1, n) printf("%d ",p[i]);
//printf("\n");

    // we have array s 
    // initialize
    l = min(l, len);
    FOR(i, 0, l){
        if(p[n]+i > len) break;
        dp[cvt(n)][p[n]+i][i] = 1;
    }
    play(cvt(n), len, l);
    // transition
    iFOR(i, n-1, 1){
        int ii = cvt(i), ni = cvt(i+1);
        memset(dp[ii], 0, sizeof dp[ii]);

        FOR(j, p[i], len){
            FOR(k, 0, l){
                if(j-p[i] > k) continue;
                // boost = j-p[i]
                if(p[i+1]+j-p[i] <= len) dp[ii][j][k] = dp[ni][p[i+1]+j-p[i]][k];
                // hard part
                int boost = j-p[i];
                // boost 1 : ask (p[i+1],k-1)
                // boost 2 : ask (p[i+1],k-2) (p[i+1]+1, k-1)
                // boost 3 : ask (p[i+1],k-3) (p[i+1]+1, k-2) (p[i+1]+2, k-1)
                // p[i+1]+x > j
                // p[i+1]+x <= min(len, p[i+1]+boost-1)
                // x >= 0
                // (p[i+1]+x, k-boost+x) ;; min(len-p[i+1],boost-1) >= x >= max(0, j-p[i+1]+1) << need fix
                // It is possible that k > boost
                // k = 5 , boost = 3
                // ask (p[i+1], 2), (p[i+1]+1, 3), (p[i+1]+2, 4)
                int mi = max(0,j-p[i+1]+1), mx = min(boost-1, len-p[i+1]);
                if(mi > mx) continue;
                dp[ii][j][k] = add(dp[ii][j][k], sum[p[i+1]+mx][k-boost+mx]);
                if(min(p[i+1]+mi, k-boost+mi)>0) dp[ii][j][k] = add(dp[ii][j][k], mod-sum[p[i+1]+mi-1][k-boost+mi-1]);
            }
        }

//printf("#%d:\n",i);
//FOR(j, 1, len){
//    FOR(k, 0, l){
//        printf("%d ",dp[ii][j][k]);
//    }
//    printf("\n");
//}
//printf("\n");

        play(ii, len, l);
    }
    int ans = 0;
    FOR(k, 0, l){
        ans = add(ans, dp[1][0][k]);
    }
    printf("%d",ans);
	return 0;
}
/*
   dp[i][j][k] = at i-th number, has value 'j' with 'k' total operations
   dp[i][j][k] = sum of dp[i+1][x][k] for x>=j
    and dp[i+1][p[i+1]+x][k-x] for p[i+1]+x >= j && x < j-p[i]
    so j-p[i+1] <= x < j-p[i]

    p[i+1]+j-p[i] >>> max(p[i],p[i+1]+j-p[i]-k)
    sum[i][j][k] = dp[i][j][k]+dp[i][j+1][k-1]+dp[i][j+2][k-2]+...

    So dp[i+1][p[i+1]+x][k-x] for j-p[i+1] <= x <= min(k, j-p[i])
    let mi = j-p[i+1], mx = min(k, j-p[i])+1
    = sum[i+1][p[i+1]+mi][k-mi] - sum[i+1][p[i+1]+ma][k-ma];
*/


Measured memory_bytes: 4904