using System;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using System.Collections.Generic;

class Myon

{
    public Myon() { }
    public static int Main()
    {
        cin = new Scanner();
        new Myon().calc();
        return 0;
    }
    static Scanner cin;
    long mod = 998244353;

    void calc()
    {
        string S = cin.next();
        int K = cin.nextInt();
        //string S = new string('0', 150) + new string('1', 150);
        //int K = 10000;

        List<int> numL = new List<int>();
        int now = 0;
        int one = 0;
        foreach (var item in S)
        {
            if (item == '0')
            {
                numL.Add(now);
                now = 0;
            }
            else { now++; one++; }
        }
        numL.Add(now);

        int[] num = numL.ToArray();
        int N = num.Length;
        K = Math.Min(K, one);
        long[,] dp = new long[K + 1, K + 1];
        dp[0, 0] = 1;

        for (int t = 0; t < num.Length; t++)
        {
            long[,] nextdp = new long[K + 1, K + 1];
            for (int i = 0; i < K + 1; i++)
            {
                for (int j = i; j < K + 1; j++)
                {
                    if (dp[i, j] == 0) continue;
                    int minK = Math.Max(0, num[t] - i);
                    for (int k = minK; k < num[t]; k++)
                    {
                        nextdp[i - (num[t] - k), j] += dp[i, j];
                        if (nextdp[i - (num[t] - k), j] >= mod) nextdp[i - (num[t] - k), j] -= mod;
                    }

                    for (int add = 0; add <= (K - j); add++)
                    {
                        nextdp[i + add, j + add] += dp[i, j];
                        if (nextdp[i + add, j + add] >= mod) nextdp[i + add, j + add] -= mod;
                    }

                }
            }
            dp = nextdp;
        }

        long ans = 0;
        for (int i = 0; i <= K; i++)
        {
            ans += dp[0, i];
        }
        ans %= mod;

        Console.WriteLine(ans);
    }

}


class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

Measured memory_bytes: 38012