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

const int N = 303;
const int MOD = 998244353;

int n, k;
char s[N];

vector<int> ones;

int dp[N][N][N];
int f(int x, int use, int sum) {
  if (use > k) return 0;
  if (x < 0) return sum == 0;
  if (~dp[x][use][sum]) return dp[x][use][sum];

  int ret = f(x-1, use, sum);
  for (int i = 1; i <= ones[x]; ++i) {
    ret = (ret + f(x-1, use + i, sum + i)) % MOD;
  }
  for (int i = 1; i <= sum; ++i) {
    ret = (ret + f(x-1, use, sum - i)) % MOD;
  }

  return dp[x][use][sum] = ret;
}

int solve() {
  scanf("%s %d", s, &k);
  
  int n = strlen(s);
  ones.push_back(0);
  for (int i = 0; i < n; ++i) {
    if (s[i] == '0') {
      ones.push_back(0);
    } else {
      ++ones.back();
    }
  }

  // for (int o: ones) cerr << o << " "; cerr << endl;

  memset(dp, -1, sizeof dp);
  printf("%d\n", f((int) ones.size() - 1, 0, 0));
  return 0;
}

int main() {
  int t = 1;
  // scanf("%d", &t);
  while (t--) solve();
  return 0;
}

#include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>

#include <istream>
#include <map>
#include <math.h>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

namespace asl
{
    
    template <typename T>
    std::vector<std::vector<T>> board(int n = 0, int m = 0)
    {
        return std::vector<std::vector<T>>(n, std::vector<T>(m));
    }

} 

namespace asl
{
    
    const int m1000000007 = 1000000007;
    
    const int m998244353 = 998244353;

    int MOD = m1000000007;

    void set_mod(int mod)
    {
        MOD = mod;
    }

    class Mint
    {
    public:
        int val;

        Mint(long long v = 0)
        {
            if (v >= 0)
            {
                if (v < MOD)
                    val = v;
                else
                    val = v % MOD;
            }
            else
            {
                if (v >= -MOD)
                {
                    val = v + MOD;
                }
                else
                {
                    v %= MOD;
                    if (v < 0)
                        v += MOD;
                    val = v;
                }
            }
        }

        Mint &operator+=(const Mint &other)
        {
            val += other.val;
            if (val >= MOD)
                val -= MOD;
            return *this;
        }

        Mint &operator-=(const Mint &other)
        {
            val -= other.val;
            if (val < 0)
                val += MOD;
            return *this;
        }

        friend std::ostream &operator<<(std::ostream &stream, const Mint &m)
        {
            return stream << m.val;
        }

    };
} 

#include <random>

#define endl '\n'

using namespace std;
using namespace asl;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    set_mod(m998244353);

    string s;
    int k;

    cin >> s >> k;

    s += "0";

    vector<int> g;
    int total = 0;
    int ones = 0;

    for (auto x : s)
    {
        if (x == '1')
        {
            ++total;
            ++ones;
        }
        else
        {
            g.push_back(total);
            total = 0;
        }
    }

    reverse(g.begin(), g.end());

    auto dp = board<Mint>(ones + 1, ones + 1);

    dp[0][0] = 1;

    for (int i = 0; i < g.size(); ++i)
    {
        auto ndp = board<Mint>(ones + 1, ones + 1);

        for (int k = 0; k <= ones; ++k)
        {
            for (int l = 0; l <= ones; ++l)
            {
                if (l > 0 && k > 0)
                    ndp[l][k] = ndp[l - 1][k - 1];

                int rmin = l - g[i] - 1; 
                if (rmin >= 0 && k - l + rmin >= 0)
                    ndp[l][k] -= dp[rmin][k - l + rmin];

                int rmax = l - 1; 
                if (rmax >= 0 && k - l + rmax >= 0)
                    ndp[l][k] += dp[rmax][k - l + rmax];
            }
        }

        for (int k = 0; k <= ones; ++k)
        {
            Mint A(0);
            for (int l = ones; l >= 0; --l)
            {
                A += dp[l][k];
                
                ndp[l][k] += A;
            }
        }

        dp.swap(ndp);
        
    }

    Mint ans;

    for (int d = 0; d <= min(ones, k); ++d)
    {
        ans += dp[0][d];
    }

    cout << ans << endl;

    return 0;
}


