Problem: Given is a string S consisting of `0` and `1`. Find the number of strings, modulo 998244353, that can result from applying the following operation on S between 0 and K times (inclusive):

* Choose a pair of integers i, j (1\leq i < j\leq |S|) such that the i-th and j-th characters of S are `0` and `1`, respectively. Remove the j-th character from S and insert it to the immediate left of the i-th character.

Constraints

* 1 \leq |S| \leq 300
* 0 \leq K \leq 10^9
* S consists of `0` and `1`.

Input

Input is given from Standard Input in the following format:


S K


Output

Find the number of strings, modulo 998244353, that can result from applying the operation on S between 0 and K times (inclusive).

Examples

Input

0101 1


Output

4


Input

01100110 2


Output

14


Input

1101010010101101110111100011011111011000111101110101010010101010101 20


Output

113434815

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define FORR(i, n) for(ll i = (ll)n - 1LL; i >= 0LL; i--)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) begin(x), end(x)
using namespace std;
using ll = long long;
constexpr ll Mod = 998244353;
constexpr ll mod = 1e9 + 7;
constexpr ll inf = 1LL << 60;
const double PI = acos(-1);
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
    return a < b && (a = b, true);
}
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
    return a > b && (a = b, true);
}
/*-------------------------------------------*/

ll dp[309][309][309];

vector<int> a;
int cnt = 0;
int d[309];

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

    string s;
    int K;
    cin >> s >> K;

    for(char c : s) {
        if(c == '0')
            cnt++;
        else
            a.push_back(cnt);
    }
    for(int i : a)
        d[i]++;

    chmin(K, a.size());

    dp[cnt + 1][0][0] = 1;

    for(int i = cnt + 1; i; i--)
        rep(j, K + 1) rep(k, a.size() + 1) {
            if(dp[i][j][k] == 0) continue;
            rep(t, d[i - 1] + k + 1) {
                int nj = j + max(0, int(d[i - 1] - t));
                dp[i - 1][nj][d[i - 1] + k - t] += dp[i][j][k];
                dp[i - 1][nj][d[i - 1] + k - t] %= Mod;
            }
        }

    ll ans = 0;
    rep(i, K + 1) ans += dp[0][i][0];

    cout << ans % Mod;

    return 0;
}