#line 1 "/mnt/c/Users/leafc/dev/compro/lib/math/modint.hpp"
#include <cassert>
#include <cstdint>
#include <iostream>
#include <vector>
#ifndef MOD_INT
#define MOD_INT

template <std::uint_fast64_t MOD> class ModInt {
  using u64 = std::uint_fast64_t;

public:
  ModInt(const u64 val = 0) { value = val % MOD; }

  ModInt operator+(const ModInt rhs) const { return ModInt(*this) += rhs; }
  ModInt operator-(const ModInt rhs) const { return ModInt(*this) -= rhs; }
  ModInt operator*(const ModInt rhs) const { return ModInt(*this) *= rhs; }
  ModInt operator/(const ModInt rhs) const { return ModInt(*this) /= rhs; }

  ModInt &operator+=(const ModInt rhs) {
    value += rhs.value;
    if (value >= MOD) {
      value -= MOD;
    }
    return *this;
  }

  ModInt &operator-=(const ModInt rhs) {
    if (value < rhs.value) {
      value += MOD;
    }
    value -= rhs.value;
    return *this;
  }

  ModInt &operator*=(const ModInt rhs) {
    value = value * rhs.value % MOD;
    return *this;
  }

  ModInt &operator/=(ModInt rhs) {
    *this *= rhs.inv();
    return *this;
  }

  ModInt &operator++(int n) {
    value++;
    if (value >= MOD) {
      value -= MOD;
    }
    return *this;
  }

  ModInt &operator--(int n) {
    if (value == 0) {
      value += MOD;
    }
    value--;
    return *this;
  }

  ModInt inv() { return ModInt::pow(*this, MOD - 2); }

  static ModInt pow(ModInt base, long long int n) {
    ModInt res = ModInt(1);
    while (n) {
      if (n & 1) {
        res *= base;
      }
      base *= base;
      n /= 2;
    }
    return res;
  }

  static ModInt comb(ModInt n, ModInt r) { return comb(n.value, r.value); }

  static ModInt comb(int n, int r) {
    if (n < r)
      return ModInt(0);
    ModInt res = ModInt(1);
    for (int i = 0; i < r; i++) {
      res *= ModInt(n - i);
    }

    ModInt inv = ModInt(1);
    for (int i = 0; i < r; i++) {
      inv *= ModInt(r - i);
    }
    return res / inv;
  }

  // nC0からnCnまでを計算する。計算量はO(n)
  // @param n     要素数
  // @param vec   結果を格納する配列
  static void combination_table(int n, std::vector<ModInt> &vec) {
    assert(static_cast<int>(vec.size()) >= n + 1);
    vec[0] = ModInt(1);
    for (int r = 1; r < n + 1; r++) {
      vec[r] = vec[r - 1] * ModInt(n - r + 1) / ModInt(r);
    }
  }

  u64 getValue() const { return value; }

private:
  u64 value;

  friend std::ostream &operator<<(std::ostream &out, const ModInt<MOD> &m) {
    out << m.value;
    return out;
  }

  friend std::istream &operator>>(std::istream &in, ModInt &m) {
    uint_fast64_t i;
    in >> i;
    m = ModInt(i);
    return in;
  }
};

#endif
#line 1 "/mnt/c/Users/leafc/dev/compro/lib/template.hpp"


#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
#define MM << " " <<

using namespace std;

template <class T> void say(bool val, T yes, T no) { cout << (val ? yes : no) << "\n"; }

void say(bool val, string yes = "Yes", string no = "No") { say<string>(val, yes, no); }

template <class T> void chmin(T &a, T b) {
  if (a > b)
    a = b;
}

template <class T> void chmax(T &a, T b) {
  if (a < b)
    a = b;
}

// C++ 17に完全移行したら消す
// 最大公約数を求める
template <class T> T gcd(T n, T m) { return n ? gcd(m % n, n) : m; }

// 最小公倍数を求める
template <class T> T lcm(T n, T m) {
  int g = gcd(n, m);
  return n * m / g;
}

// 重複を消す。計算量はO(NlogN)
template <class T> void unique(std::vector<T> &v) {
  std::sort(v.begin(), v.end());
  v.erase(std::unique(v.begin(), v.end()), v.end());
}


#line 3 "tmp.cpp"

using mint = ModInt<998244353>;

mint memo[310][310][310] = {};
bool checked[310][310][310] = {};

mint dfs(int i, int stock, int k, const vi a) {
  if (k < 0)
    return mint(0);
  if (checked[i][stock][k])
    return memo[i][stock][k];
  if (i == 0) {
    checked[i][stock][k] = true;
    memo[i][stock][k] = mint(1);
    return memo[i][stock][k];
  }

  // j: 残す数
  REP(j, a[i] + stock + 1) {
    int nk = k - max(0, a[i] - j);
    memo[i][stock][k] += dfs(i - 1, a[i] + stock - j, nk, a);
  }

  checked[i][stock][k] = true;
  return memo[i][stock][k];
}

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

  string s;
  cin >> s;
  int k;
  cin >> k;

  vector<int> a;
  int n = s.length();
  int cnt = 0;
  REP(i, n) {
    if (s[i] == '0') {
      a.push_back(cnt);
      cnt = 0;
    } else {
      cnt++;
    }
  }
  if (s[n - 1] == '1')
    a.push_back(cnt);

  n = a.size();
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }

  cout << dfs(n - 1, 0, min(309, k), a) << endl;

  return 0;
}


Measured memory_bytes: 240408