#include <bits/stdc++.h>
template <typename T>
inline void read(T &x) {
  char c;
  bool nega = 0;
  while ((!isdigit(c = getchar())) && (c != '-'))
    ;
  if (c == '-') {
    nega = 1;
    c = getchar();
  }
  x = c - 48;
  while (isdigit(c = getchar())) x = x * 10 + c - 48;
  if (nega) x = -x;
}
template <typename T>
inline void writep(T x) {
  if (x > 9) writep(x / 10);
  putchar(x % 10 + 48);
}
template <typename T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  writep(x);
  putchar(' ');
}
template <typename T>
inline void writeln(T x) {
  write(x);
  putchar('\n');
}
using namespace std;
const int mod = 998244353;
int n, len, k, dp[100005][101], cnt[101];
void Add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k >> len;
  dp[0][0] = 1;
  for (int i = (1); i <= (n); ++i) {
    int x;
    cin >> x;
    for (int j = (1); j <= (k); ++j)
      if (x == -1 || x == j) {
        ++cnt[j];
        Add(dp[i][j], dp[i - 1][0]);
        if (cnt[j] >= len) {
          Add(dp[i][j], mod - dp[i - len][0]);
          Add(dp[i][j], dp[i - len][j]);
        }
        Add(dp[i][0], dp[i][j]);
      } else
        cnt[j] = 0;
  }
  cout << dp[n][0];
  return 0;
}
