#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>
#include <numeric>
#include <string.h>
#include <iomanip>
#include <sys/time.h>
#include <random>


#define fs first
#define sc second
#define endl "\n"

using namespace std;

typedef long long ll;
typedef unsigned int uint;
typedef pair<ll, ll> P;

class modInt{
    ll value;
    static const ll mod = 998244353;

public:
    modInt(ll x=0): value{x % mod}{}

    inline modInt& operator+=(modInt x){
        value = (value + x.value) % mod;
        return *this;
    }

    inline modInt& operator-=(modInt x){
        value = (value + mod - x.value) % mod;
        return *this;
    }

    inline modInt& operator*=(modInt x){
        value = (value * x.value) % mod;
        return *this;
    }


    inline modInt operator/=(modInt x){
        *this *= x.inv();
        return *this;
    }

    inline modInt pow(ll n){
        modInt res = modInt(1LL);
        modInt x{value};
        while(n > 0){
            if(n & 1)   res *= x;
            x *= x;
            n >>= 1;
        }
        return res;
    }

    inline modInt inv(){
        modInt res = pow(mod-2);
        return res;
    }

    inline ll get(){
        return value;
    }
};

modInt operator+(modInt x, modInt y){
    return x += y;
}

modInt operator-(modInt x, modInt y){
    return x -= y;
}

modInt operator*(modInt x, modInt y){
    return x *= y;
}

modInt operator/(modInt x, modInt y){
    return x /= y;
}

ostream& operator<<(ostream& os, modInt x){
    return os << x.get();
}


class modIntCombinations{
    vector<modInt> factArray;

    void make_fact(ll x){
        for(auto i = factArray.size(); i <= x+1; i++){
            modInt y = factArray[i-1] * i;
            factArray.push_back(y);
        }
    }

public:
    modIntCombinations(){
        factArray.emplace_back(1);
    }

    modInt fact(ll x){
        if(factArray.size() < x+1){
            make_fact(x);
        }
        return factArray[x];
    }

    modInt comb(ll n, ll k){
        if(n < k){
            return modInt{0};
        }
        else{
            return fact(n) / fact(k) / fact(n - k);
        }
    }

    modInt perm(ll n, ll k){
        if(n < k){
            return modInt{0};
        }
        else{
            return fact(n) / fact(k);
        }
    }
};


int main(){
    string s;   ll k;
    cin >> s >> k;

    vector<int> x;
    int count = 0;
    for(int i = 0; i < s.length(); i++){
        if(s[i] == '1') count++;
        else{
            x.push_back(count);
            count = 0;
        }
    }
    x.push_back(count);

    ll ma = 0;
    int n = x.size();
    for(int i = 1; i < n; i++){
        ma += x[i];
    }
    k = min(k, ma);

    vector<vector<vector<modInt>>> dp(n+1, vector<vector<modInt>>(k+1, vector<modInt>(k+1, 0)));
    dp[n][0][0] = 1;
    for(int i = n; i > 0; i--){
        for(int j = 0; j <= k; j++){
            for(int l = 0; l <= j; l++){
                if(dp[i][j][l].get() == 0)  continue;
                // 渡す
                for(int y = 0; y <= x[i-1]; y++){
                    if(y + j > k)   break;
                    dp[i-1][j+y][l+y] += dp[i][j][l];
//                    cout << i-1 << " " << j + y << " " << l+y << " " << dp[i-1][j+y][l+y] << endl;
                }

                // もらう
                for(int y = 1; y <= l; y++){
                    dp[i-1][j][l-y] += dp[i][j][l];
//                    cout << i-1 << " " << j << " " << l-y << " " << dp[i-1][j][l-y] << endl;
                }
            }
        }
    }

    modInt res = 0;
    for(int i = 0; i <= k; i++){
        res += dp[0][i][0];
    }

    cout << res << endl;


    return 0;
}


Measured memory_bytes: 30452