program shift
  implicit none
  integer(8), parameter :: p = 998244353
  character(300) :: s
  integer :: k, n, c(0:301) = 0, m = 0, i, j, x = 0
  integer(8) :: dp(0:301, 0:301) = 0
  integer(8) :: ans = 0
  read(*,*) s, k
  n = len_trim(s)
  do i = 1, n
    if (s(i:i) == '0') m = m + 1
  end do
  if (m == 0 .or. m == n) then
    write(*,'(i0)') 0
    stop
  end if
  m = m + 1
  j = m
  do i = n, 1, -1
    if (s(i:i) == '0') then
      j = j - 1
    else
      c(j) = c(j) + 1
    end if
  end do
  dp(m, 0) = 1
  x = c(m)
  do i = m - 1, 0, -1
    do j = x, 0, -1
      dp(i, j) = mod(sum(dp(i + 1, max(j - k, 0):j)), p)
    end do
    x = x + c(i)
  end do
  do i = 0, k
    ans = mod(ans + dp(0, i), p)
  end do
  write(*,'(i0)') ans
end program shift