#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <complex>
#include <vector>
#include<limits>
#include<iomanip>
#include<cassert>

using namespace std;

typedef long long ll;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;

const long double pi = 3.141592653589793;

#define debug(x) cout << #x << " = " << (x) << endl;
#define rep(i, n) for(int i = 0;i < n;i++)
#define repi(i, j, n) for(int i = j;i < n;i++)
#define pb push_back
#define mp make_pair
#define mod 998244353
#define F first
#define S second

string s;int k, n;

/*
  --- 0 111111  ----------
      i'     i     (j)

      i(3) j(3) k(5)

      O(N ** 3)
*/

// unordered_map<ll, int> dp;
// ll state_to_num(int i, int j, int k) {
//   return 1LL*i*1E10 + 1LL*j*1E6 + k;
// }
//
// int combinations(int i, int j, int k) {
//   if(i < 0) return 1;
//   if(dp.count(state_to_num(i, j, k)) == 1) {
//     return dp[state_to_num(i, j, k)];
//   }
//
//   int id = i;
//   while(id >= 0 && s[id] == '1') id--;
//   if(id == -1) return 1;
//   int ans = 0;
//   for(int ps = 0;ps <= (i-id+j);ps++) {
//     if(ps <= j) {
//       ans += combinations(id-1, ps, k);
//     } else if(ps-j <= k) {
//       ans += combinations(id-1, ps, k-ps+j);
//     }
//     ans %= mod;
//   }
//   return dp[state_to_num(i, j, k)] = ans;
// }

int dp[303][303][303], help[303][303][303], zo[333];

void update_dp_help(int i) {
  for(int j = 0;j <= n;j++) {
    for(int k = n;k >= 0;k--) {
      help[i][j][k] = dp[i][j][k];
      if(j-1 >= 0 && k+1 <= n) {
        help[i][j][k] += help[i][j-1][k+1];
      }
      help[i][j][k] %= mod;
      if(j-1 >= 0) {
        dp[i][j][k] += dp[i][j-1][k];
      }
      dp[i][j][k] %= mod;
    }
  }
}

int main() {

 // freopen("input.in","r",stdin);
 // freopen("output.out","w",stdout);

 cin>>s>>k;
 n = s.size();
 k = min(k, n);

 for(int i = 1;i <= n;i++) {
   if(s[i-1] == '0') zo[i] = i;
   else zo[i] = zo[i-1];
 }

 rep(j, n+1) rep(k, n+1) dp[0][j][k] = 1;
 update_dp_help(0);

 /*
   --- 0 111111  ----------
       i'     i     (j)
 */

 for(int i = 1;i <= n;i++) {
   for(int j = 0;j <= n;j++) {
     for(int k = 0;k <= n;k++) {
       int id = zo[i];
       if(id == 0) {dp[i][j][k] = 1;continue;}
       int x = min(j, i-id+j);
       (dp[i][j][k] += dp[id-1][x][k]) %= mod;
       int ct1 = i-id+j-x;
       // x + 1, x + 2, x + 3, ...
       int ct2 = k + j - x;
       int ct = min(ct1, ct2);
       if(ct > 0) {
         int u = j+ct, v = k-ct;
         if(u > n) {
           v += (u-n);
           u -= (u-n);
         }
         if(v < 0) {
           u += v;
           v -= v;
         }
         dp[i][j][k] += (help[id-1][u][v]-help[id-1][x][k])%mod;
         dp[i][j][k] %= mod;
         if(dp[i][j][k] < 0) dp[i][j][k] += mod;


       }

       // debug(i);
       // debug(j);
       // debug(k);
       // cout<<dp[i][j][k]<<endl<<endl;
     }
   }
   update_dp_help(i);
 }

 cout << dp[n][0][k] << endl;

 return 0;
}


Measured memory_bytes: 219544