#include <bits/stdc++.h>
using namespace std;
const int INF = 1e6;
struct st {
  int n;
  vector<int> t;
  st(int sz) {
    n = sz;
    t.resize(2 * n);
    for (int& x : t) x = INF;
  }
  void upd(int pos, int val) {
    for (t[pos += n] = val; pos > 1; pos >>= 1)
      t[pos >> 1] = min(t[pos], t[pos ^ 1]);
  }
  int qry(int l, int r) {
    int ans = INF;
    for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
      if (l & 1) ans = min(ans, t[l++]);
      if (r & 1) ans = min(ans, t[--r]);
    }
    return ans;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, mxd, len;
  cin >> n >> mxd >> len;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  map<int, int> cnt;
  int g[n];
  int l = 0, r = 0, mn, mx;
  while (r < n) {
    cnt[a[r]]++;
    mn = cnt.begin()->first;
    mx = (--cnt.end())->first;
    while (mx - mn > mxd) {
      if (--cnt[a[l]] == 0) {
        cnt.erase(a[l]);
        if (a[l] == mn)
          mn = cnt.begin()->first;
        else if (a[l] == mx)
          mx = (--cnt.end())->first;
      }
      l++;
    }
    g[r] = r - l + 1;
    r++;
  }
  st rmq(n);
  int dp[n];
  for (int i = 0; i < n; i++) {
    l = i - g[i];
    r = i - len;
    if (l <= r) {
      if (l == -1)
        dp[i] = 1;
      else
        dp[i] = rmq.qry(l, r + 1) + 1;
    } else
      dp[i] = INF;
    rmq.upd(i, dp[i]);
  }
  if (dp[n - 1] > n)
    cout << -1;
  else
    cout << dp[n - 1];
}
