//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define st first
#define nd second

using namespace __gnu_pbds;
using namespace std;
 
template <typename T>
using ordered_set =
	tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
 
#define shandom_ruffle random_shuffle
 
using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;

const int kMaxN = 330;
const int mod = 998244353;

int dp[kMaxN][kMaxN][kMaxN];
int last_nd[kMaxN][kMaxN];
int last_diag[kMaxN][kMaxN];

inline void Add(int &a, int b) {
	a += b;
	if (a >= mod) { a -= mod; }
}

int nparts;
vi splits;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(11);
	cerr << fixed << setprecision(6);

	int K;
	string s;
	cin >> s >> K;

	K = min(K, SZ(s));
	const int N = SZ(s);

	splits.push_back(0);
	++nparts;
	int ones = 0;
	for (char ch : s) {
		if (ch == '0') {
			splits.push_back(0);
			++nparts;
		} else {
			++splits.back();
			++ones;
		}
	}

	debug() << imie(nparts) << imie(splits) << imie(ones);

	dp[0][0][0] = 1;
	int min_sum = 0;

	for (int pid = 1; pid <= nparts; ++pid) {
		const int a = splits[pid - 1];
		min_sum += a;

		for (int i = 0; i <= N; ++i) {
			for (int j = 0; j <= N; ++j) {
				last_nd[i][j] = last_diag[i][j] = dp[pid - 1][i][j];

				if (i && j) {
					Add(last_diag[i][j], last_diag[i - 1][j - 1]);
				}
				if (i) {
					Add(last_nd[i][j], last_nd[i - 1][j]);
				}
			}
		}
		
		for (int sum = min_sum; sum <= ones; ++sum) {
			for (int curk = 0; curk <= K; ++curk) {
				//~ for (int i = 0; i < a && i <= sum; ++i) {
					//~ Add(dp[pid][sum][curk], dp[pid-1][sum-i][curk]);
				//~ }
				Add(dp[pid][sum][curk], last_nd[sum][curk]);
				if (sum - a >= 0) {
					Add(dp[pid][sum][curk], mod - last_nd[sum - a][curk]);
				}
				//~ for (int i = 0; i <= curk && sum - a - i >= 0; ++i) {
					//~ Add(dp[pid][sum][curk], dp[pid-1][sum-a-i][curk-i]);
				//~ }
				if (sum - a >= 0) {
					Add(dp[pid][sum][curk], last_diag[sum - a][curk]);
				}

				debug() << imie(pid) << imie(sum) << imie(curk) << dp[pid][sum][curk];
			}
		}
	}

	int ans = 0;
	for (int curk = 0; curk <= K; ++curk) {
		Add(ans, dp[nparts][ones][curk]);
	}

	cout << ans << "\n";
}


Measured memory_bytes: 33396