#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
const int BASE = 27;
const long long oo = 1e18;
const double EPS = 1e-9;
const int N = 100010;
int n, k, len, a[N], dp[N][102], best[N][102], pre[N][102], sum[N];
long long adl(long long a, long long b) { return (a + b) % MOD; }
long long mul(long long a, long long b) { return (a * b) % MOD; }
long long subl(long long a, long long b) { return (a - b + MOD) % MOD; }
int main() {
  cin >> n >> k >> len;
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  for (int j = 1; j <= k; ++j) {
    int idx = 0;
    for (int i = 0; i < n; ++i) {
      if (idx < i) idx = i;
      while (idx - i + 1 < len && idx < n && (a[idx] == j || a[idx] == -1))
        idx++;
      best[i][j] = idx - 1;
    }
  }
  dp[n][k + 1] = 1;
  sum[n] = 1;
  for (int idx = n - 1; idx >= 0; --idx) {
    sum[idx] = sum[idx + 1];
    for (int cur = 1; cur <= k; ++cur) {
      int maxR = best[idx][cur];
      int &ret = dp[idx][cur];
      if (maxR < idx) continue;
      int L = idx + 1, R = maxR + 1;
      ret = subl(sum[L], sum[R + 1]);
      ret = subl(ret, subl(pre[L][cur], pre[R + 1][cur]));
    }
    for (int cur = 1; cur <= k; ++cur) {
      pre[idx][cur] = adl(dp[idx][cur], pre[idx + 1][cur]);
      sum[idx] = adl(sum[idx], dp[idx][cur]);
    }
  }
  long long ans = 0;
  for (int i = 1; i <= k; ++i) ans = adl(ans, dp[0][i]);
  cout << ans << endl;
  return 0;
}
