#include<bits/stdc++.h>
#define ll long long
using namespace std;

ll dp[309][309][309],A[309],S[309][309][309];
ll mod = 998244353;
void admod(ll &x, ll y){
    x = (x +y) % mod;
}
main(){
    string s;
    ll k;
    cin >> s >> k;
    ll n = s.size();
    if(k > n) k = n;
    vector<ll> A;
    ll o = 0;
    for(ll i = 0; i < n; i++){
        if(s[i] == '1') o++;
        else A.push_back(o), o =0;
    }
    A.push_back(o);
    ll m = A.size();
    reverse(A.begin(),A.end());

    dp[0][0][0] = 1;
    for(ll i = 0; i <= m; i++){
        for(ll s = 0; s <= k; s++)
            for(ll j = k; j >=0; j--)
                admod(S[i][s][j], S[i][s][j+1]);
        for(ll car = 0; car <= k; car ++){
            for(ll pl = 0; car + pl <= k; pl++){

                admod(dp[i][car][pl], S[i][car+pl][car]);
                if(i < m){
                    admod(S[i+1][car+pl][car] , dp[i][car][pl]);
                    for(ll j = 1; j <= A[i]; j++)
                        admod(dp[i+1][car + j][pl],  dp[i][car][pl]);
                }

            }
        }
    }
    ll ans = 0;
    for(ll i = 0; i <= k; i++)
        admod(ans, dp[m][0][i] );
    cout<<ans<<endl;

}

#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void){
    int a, b, h = 100, w = 100;
    string s[100];
    char wht = '.', blk = '#';
    cin >> a >> b;
    if(a > b){
        int t = a;
        a = b;
        b = t;
        wht = '#';
        blk = '.';
    }
    for(int i=0;i<h;i++){
        s[i] = string(w, wht);
    }
    for(int i=1;i<h&&b>0;i+=4){
        for(int j=1;j<w&&b>0;j+=4){
            for(int k=-1;k<=1;k++){
                for(int l=-1;l<=1;l++){
                    s[i+k][j+l] = blk;
                }
            }
            b--;
        }
    }
    a--;
    for(int i=1;i<h&&a>0;i+=4){
        for(int j=1;j<w&&a>0;j+=4){
            s[i][j] = wht;
            a--;
        }
    }
    
    cout << h << " " << w << endl;
    for(int i=0;i<h;i++){
        cout << s[i] << endl;
    }
}
