Problem: Given is a string S consisting of `0` and `1`. Find the number of strings, modulo 998244353, that can result from applying the following operation on S between 0 and K times (inclusive):

* Choose a pair of integers i, j (1\leq i < j\leq |S|) such that the i-th and j-th characters of S are `0` and `1`, respectively. Remove the j-th character from S and insert it to the immediate left of the i-th character.

Constraints

* 1 \leq |S| \leq 300
* 0 \leq K \leq 10^9
* S consists of `0` and `1`.

Input

Input is given from Standard Input in the following format:


S K


Output

Find the number of strings, modulo 998244353, that can result from applying the operation on S between 0 and K times (inclusive).

Examples

Input

0101 1


Output

4


Input

01100110 2


Output

14


Input

1101010010101101110111100011011111011000111101110101010010101010101 20


Output

113434815

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

string S;
int N,K;

const ll mo=998244353;


ll from[303][306];
ll to[303][306];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>S>>K;
	vector<int> V;
	V.push_back(0);
	
	int sum=0;
	FORR(c,S) {
		if(c=='1') V.back()++, sum++;
		else V.push_back(0);
	}
	K=min(K,sum);
	N=V.size();
	
	from[K][0]=1;
	FOR(y,V.size()) {
		int v=V[y];
		ZERO(to);
		for(j=K;j>=0;j--) {
			for(i=0;i<=sum;i++) if(from[j][i]) {
				for(int tar=0;tar<=min(v+j,sum);tar++) {
					if(y==V.size()-1 && tar>v) break;
					if(tar<=v) {
						if(i+(tar-v)>=0) (to[j][i+(tar-v)]+=from[j][i])%=mo;
					}
					else {
						(to[j-(tar-v)][i+(tar-v)]+=from[j][i])%=mo;
					}
				}
			}
		}
		swap(from,to);
	}
	
	ll ret=0;
	FOR(i,K+1) ret+=from[i][0];
	cout<<ret%mo<<endl;
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}