#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(ll i = (ll)a;i < (ll)b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(ll i = (ll)b-1LL;i >= (ll)a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)
#define SIGN(a) (a==0?0:(a>0?1:-1))

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<ld,ld> pdd;

pll operator+(pll a,pll b){
  return pll(a.first+b.first,a.second+b.second);
}
pll operator-(pll a,pll b){
  return pll(a.first-b.first,a.second-b.second);
}
pll operator*(ll a,pll b){
  return pll(b.first*a,b.second*a);
}
const ll INF=(1LL<<60);
#if __cplusplus<201700L
ll gcd(ll a, ll b) {
  a=abs(a);
  b=abs(b);
  if(a==0)return b;
  if(b==0)return a;
  if(a < b) return gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
#endif
template<class T>
bool chmax(T& a,const T& b){
  if(a<b){
    a=b;
    return true;
  }
  return false;
}
template<class T>
bool chmin(T& a,const T& b){
  if(a>b){
    a=b;
    return true;
  }
  return false;
}
template<class S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}

const long long MOD = 998244353;
template<long long m>
class Modulo{
  long long a;
public:
  Modulo(){
    a=0;
  }
  Modulo(const long long b){
    a=(b%m+m)%m;
  }
  Modulo(const Modulo& b){
    a=b.a;
  }
  Modulo &operator = (const long long b){
    a=(b%m+m)%m;
    return *this;
  }
  Modulo &operator = (const Modulo& b){
    a=b.a;
    return *this;
  }
  Modulo operator + (const Modulo<m> &b)const{
    return {(a+b.a)%m};
  }
  Modulo operator - (const Modulo<m> &b)const{
    return {(a-b.a+m)%m};
  }
  Modulo operator * (const Modulo<m> &b)const{
    return {(a*b.a)%m};
  }
  Modulo operator / (const Modulo<m> &b)const{
    return {(a*inverse(b,m))%m};
  }
  Modulo operator + (const long long b)const{
    return {(a+b)%m};
  }
  Modulo operator - (const long long b)const{
    return {((a-b)%m+m)%m};
  }
  Modulo operator * (const long long b)const{
    return {(a*b)%m};
  }
  Modulo operator += (const Modulo<m> &b){
    this->a=(a+b.a)%m;
    return {(a+b.a)%m};
  }
  Modulo operator -= (const Modulo<m> &b){
    this->a=(a-b.a+m)%m;
    return {(a-b.a+m)%m};
  }
  Modulo operator *= (const Modulo<m> &b){
    this->a=(a*b.a)%m;
    return {(a*b.a)%m};
  }
  Modulo operator += (const long long b){
    this->a=(a+b)%m;
    return {(a+b)%m};
  }
  Modulo operator -= (const long long b){
    this->a=((a-b)%m+m)%m;
    return {((a-b)%m+m)%m};
  }
  Modulo operator *= (const long long b){
    this->a=(a*b)%m;
    return {(a*b)%m};
  }
  Modulo operator < (const Modulo<m> &b)const{
    return a<b.a;
  }
  Modulo operator > (const Modulo<m> &b)const{
    return a>b.a;
  }
  operator long long() const{return a;}
};
template<long long m>
std::ostream& operator<<(std::ostream& os,Modulo<m> a){
  os<<(long long)(a);
  return os;
}
Modulo<MOD> dp[301][301][301];
void solve(std::string S, long long K){
  reverse(S.begin(),S.end());
  vector<ll> s;
  K=min(300LL,K);
  ll cur=0;
  bool flag=false;
  for (auto &&i : S)
  {
    if(i=='1'){
      ++cur;
      flag=true;
    }else if(flag==true){
      s.push_back(cur);
      cur=0;
    }
  }
  s.push_back(cur);
  cur=0;
  dp[0][0][K]=1;
  FOR(i,0,s.size()){
    For(k,K+1){
      vector<Modulo<MOD>> tmp(K+1);
      For(j,K+1){
        if(j+1<K+1)tmp[j+1]+=dp[i][j][k];
        if(K-k+1<K+1)tmp[K-k+1]-=dp[i][j][k];
      }
      partial_sum(tmp.begin(),tmp.end(),tmp.begin());
      For(j,K+1){
        dp[i+1][j][k]+=tmp[j];
      }
    }
    For(j,K+1){
      vector<Modulo<MOD>> tmp(K+1);
      For(k,K+1){
        tmp[max(0LL,k-s[i])]+=dp[i][j][k];
        if(k+1<K+1)tmp[k+1]-=dp[i][j][k];
      }
      partial_sum(tmp.begin(),tmp.end(),tmp.begin());
      For(k,K+1){
        dp[i+1][j][k]+=tmp[k];
      }
    }
  }
  Modulo<MOD> ans(0);
  For(j,K+1){
    ans+=dp[s.size()][j][K-j];
  }
  cout<<ans<<endl;
}

int main(){
  cout<<setprecision(1000);
    std::string S;
    std::cin >> S;
    long long K;
    scanf("%lld",&K);
    solve(S, K);
    return 0;
}


Measured memory_bytes: 216736