#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 100005
#define INF 2100100100
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	int mx,mn;
	info() {}
	info(int x,int y) { mn = x; mx = y; }
};
info tree[4*Max];
int ara[Max];
int n,s,d;

inline info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(int ind,int b,int e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(int ind,int b,int e,int i,int j)
{
	if(i > j) return info(INF,-INF);
	if(b == i && e == j) return tree[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
}

int Find(int l,int r)
{
	int low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		assert( (my.mx - my.mn) >= 0 && (my.mx - my.mn) <= 2000000000 );
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

int dp[Max];
int fuck[Max];
void U(int ind,int b,int e,int i,int x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
}

int Q1(int ind,int b,int e,int i,int j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

int solve()
{
	dp[0] = 0;
	U(1,1,n+1,1,0);
	int i;
	rep(i,n) U(1,1,n+1,i,INF);
	rep(i,n)
	{
		int r = i;
		int l = r - d + 1;
		if(l < 1) dp[i] = INF;
		else
		{
			int idx = Find(l,r);
			if( idx == -1 ) dp[i] = INF;
			else
			{
				int val = Q1(1,1,n+1,idx,l);
				dp[i] = val + 1;
			}
		}
		U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	int i;
    siii(n,s,d);
    rep(i,n) si(ara[i]), ara[i] += 1000000000;
    rep(i,n) assert( 0 <= ara[i] && ara[i] <= 2000000000 );
    init(1,1,n);
    int ret = solve();
    if( ret > n ) ret = -1;
    pi( ret ); NL;
	return 0;
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 100005
#define INF 2000000100
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	int mx,mn;
	info() {}
	info(int x,int y) { mn = x; mx = y; }
};
info tree[4*Max];
int ara[Max];
int n,s,d;

inline info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(int ind,int b,int e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(int ind,int b,int e,int i,int j)
{
	if(i > j) return info(INF,-1);
	if(b == i && e == j) return tree[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
}

inline bool oka(int mn,int mx)
{
	if( mn < 0 || mn > INF ) return 0;
	if( mx < 0 || mx > INF ) return 0;
	return 1;
}

int Find(int l,int r)
{
	int low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

int dp[Max];
int fuck[Max];
void U(int ind,int b,int e,int i,int x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
}

int Q1(int ind,int b,int e,int i,int j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

int solve()
{
	dp[0] = 0;
	U(1,1,n+1,1,0);
	int i;
	rep(i,n)
	{
		int r = i;
		int l = r - d + 1;
		if(l < 1) dp[i] = INF;
		else
		{
			int idx = Find(l,r);
			if( idx == -1 ) dp[i] = INF;
			else
			{
				int val = Q1(1,1,n+1,idx,l);
				dp[i] = val + 1;
			}
		}
		U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	int i;
    siii(n,s,d);
    rep(i,n) si(ara[i]), ara[i] += 1000000000;
    rep(i,n) assert( 0 <= ara[i] && ara[i] <= 2000000000 );
    init(1,1,n);
    int ret = solve();
    if( ret > n ) ret = -1;
    pi( ret ); NL;
	return 0;
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 100005
#define INF 2100100100
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	int mx,mn;
	info() {}
	info(int x,int y) { mn = x; mx = y; }
};
info tree[4*Max];
int ara[Max];
int n,s,d;

inline info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(int ind,int b,int e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(int ind,int b,int e,int i,int j)
{
	if(i > j) return info(INF,-INF);
	if(b == i && e == j) return tree[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
}

int Find(int l,int r)
{
	int low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		assert( (my.mx - my.mn) >= 0 && (my.mx - my.mn) <= 2000000000 );
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

int dp[Max];
int fuck[Max];
void U(int ind,int b,int e,int i,int x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
}

int Q1(int ind,int b,int e,int i,int j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

int solve()
{
	dp[0] = 0;
	U(1,1,n+1,1,0);
	int i;
	rep(i,n) U(1,1,n+1,i+1,INF);
	rep(i,n)
	{
		int r = i;
		int l = r - d + 1;
		if(l < 1) dp[i] = INF;
		else
		{
			int idx = Find(l,r);
			if( idx == -1 ) dp[i] = INF;
			else
			{
				int val = Q1(1,1,n+1,idx,l);
				dp[i] = val + 1;
			}
		}
		U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	int i;
    siii(n,s,d);
    rep(i,n) si(ara[i]), ara[i] += 1000000000;
    rep(i,n) assert( 0 <= ara[i] && ara[i] <= 2000000000 );
    init(1,1,n);
    int ret = solve();
    if( ret > n ) ret = -1;
    pi( ret ); NL;
	return 0;
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 100005
#define INF (LL)1e15
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	LL mx,mn;
	info() {}
	info(LL x,LL y) { mn = x; mx = y; }
};
info tree[4*Max];
LL ara[Max];
LL n,s,d;

info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(LL ind,LL b,LL e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(LL ind,LL b,LL e,LL i,LL j)
{
	if(i > j) return info(INF,-INF);
	if(b == i && e == j) return tree[ind];
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
}

LL Find(LL l,LL r)
{
	LL low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

LL dp[Max];
LL fuck[Max];
void U(LL ind,LL b,LL e,LL i,LL x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
}

LL Q1(LL ind,LL b,LL e,LL i,LL j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

LL solve()
{
	dp[0] = 0;
	//U(1,1,n+1,1,0);
	LL i;
	rep(i,n)
	{
		LL r = i;
		LL l = r - d + 1;
		if(l < 1) dp[i] = INF;
		else
		{
			LL idx = Find(l,r);
			if( idx == -1 ) dp[i] = INF;
			else
			{
				//LL val = Q1(1,1,n+1,idx,l);
				//dp[i] = val + 1;
				dp[i] = dp[idx-1] + 1;
			}
		}
		//U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	LL i;
    slll(n,s,d);
    rep(i,n) sl(ara[i]);
    init(1,1,n);
    LL ret = solve();
    if( ret > n ) ret = -1;
    pl( ret ); NL;
	return 0;
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 100005
#define INF (LL)1e15
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	LL mx,mn;
	info() {}
	info(LL x,LL y) { mn = x; mx = y; }
};
info tree[4*Max];
LL ara[Max];
LL n,s,d;

inline info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(LL ind,LL b,LL e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(LL ind,LL b,LL e,LL i,LL j)
{
	if(i > j) return info(INF,-INF);
	if(b == i && e == j) return tree[ind];
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
}

LL Find(LL l,LL r)
{
	LL low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

LL dp[Max];
LL fuck[Max];
void U(LL ind,LL b,LL e,LL i,LL x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
}

LL Q1(LL ind,LL b,LL e,LL i,LL j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

LL solve()
{
	dp[0] = 0;
	U(1,1,n+1,1,0);
	LL i;
	rep(i,n)
	{
		LL r = i;
		LL l = r - d + 1;
		if(l < 1) dp[i] = INF;
		else
		{
			LL idx = Find(l,r);
			if( idx == -1 ) dp[i] = INF;
			else
			{
				LL val = Q1(1,1,n+1,idx,l);
				dp[i] = val + 1;
			}
		}
		U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	LL i;
    slll(n,s,d);
    rep(i,n) sl(ara[i]);
    init(1,1,n);
    LL ret = solve();
    if( ret > n ) ret = -1;
    pl( ret ); NL;
	return 0;
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 100005
#define INF 2100100100
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	int mx,mn;
	info() {}
	info(int x,int y) { mn = x; mx = y; }
};
info tree[4*Max];
int ara[Max];
int n,s,d;

inline info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(int ind,int b,int e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(int ind,int b,int e,int i,int j)
{
	if(i > j) return info(INF,-INF);
	if(b == i && e == j) return tree[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
}

inline bool oka(int mn,int mx)
{
	if( mn < 0 || mn > INF ) return 0;
	if( mx < 0 || mx > INF ) return 0;
	return 1;
}

int Find(int l,int r)
{
	int low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

int dp[Max];
int fuck[Max];
void U(int ind,int b,int e,int i,int x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
}

int Q1(int ind,int b,int e,int i,int j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

int solve()
{
	dp[0] = 0;
	U(1,1,n+1,1,0);
	int i;
	rep(i,n)
	{
		int r = i;
		int l = r - d + 1;
		if(l < 1) dp[i] = INF;
		else
		{
			int idx = Find(l,r);
			if( idx == -1 ) dp[i] = INF;
			else
			{
				int val = Q1(1,1,n+1,idx,l);
				dp[i] = val + 1;
			}
		}
		U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	int i;
    siii(n,s,d);
    rep(i,n) si(ara[i]), ara[i] += 1000000000;
    rep(i,n) assert( 0 <= ara[i] && ara[i] <= 2000000000 );
    init(1,1,n);
    int ret = solve();
    if( ret > n ) ret = -1;
    pi( ret ); NL;
	return 0;
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 100005
#define INF 2100100100
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	int mx,mn;
	info() {}
	info(int x,int y) { mn = x; mx = y; }
};
info tree[4*Max];
int ara[Max];
int n,s,d;

inline info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(int ind,int b,int e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(int ind,int b,int e,int i,int j)
{
	if(i > j) return info(INF,-INF);
	if(b == i && e == j) return tree[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
}

inline bool oka(int mn,int mx)
{
	if( mn < 0 || mn > INF ) return 0;
	if( mx < 0 || mx > INF ) return 0;
	return 1;
}

int Find(int l,int r)
{
	int low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

int dp[Max];
int fuck[Max];
void U(int ind,int b,int e,int i,int x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
}

int Q1(int ind,int b,int e,int i,int j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

int solve()
{
	dp[0] = 0;
	U(1,1,n+1,1,0);
	int i;
	rep(i,n)
	{
		int r = i;
		int l = r - d + 1;
		if(l < 1) dp[i] = INF;
		else
		{
			int idx = Find(l,r);
			if( idx == -1 ) dp[i] = INF;
			else
			{
				int val = Q1(1,1,n+1,idx,l);
				assert( val < n );
				dp[i] = val + 1;
			}
		}
		U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	int i;
    siii(n,s,d);
    rep(i,n) si(ara[i]), ara[i] += 1000000000;
    rep(i,n) assert( 0 <= ara[i] && ara[i] <= 2000000000 );
    init(1,1,n);
    int ret = solve();
    if( ret > n ) ret = -1;
    pi( ret ); NL;
	return 0;
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 100005
#define INF 1000000100
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	int mx,mn;
	info() {}
	info(int x,int y) { mn = x; mx = y; }
};
info tree[4*Max];
int ara[Max];
int n,s,d;

inline info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(int ind,int b,int e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(int ind,int b,int e,int i,int j)
{
	if(i > j) return info(INF,-INF);
	if(b == i && e == j) return tree[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
}

int Find(int l,int r)
{
	int low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

int dp[Max];
int fuck[4*Max];
void U(int ind,int b,int e,int i,int x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
}

int Q1(int ind,int b,int e,int i,int j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

int solve()
{
	dp[0] = 0;
	U(1,1,n+1,1,0);
	int i;
	rep(i,n)
	{
		int r = i;
		int l = r - d + 1;
		if(l < 1) dp[i] = INF;
		else
		{
			int idx = Find(l,r);
			if( idx == -1 ) dp[i] = INF;
			else
			{
				int val = Q1(1,1,n+1,idx,l);
				dp[i] = val + 1;
			}
		}
		U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	int i;
    siii(n,s,d);
    rep(i,n) si(ara[i]);
    init(1,1,n);
    int ret = solve();
    if( ret > n ) ret = -1;
    pi( ret ); NL;
	return 0;
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 200005
#define INF (LL)1e15
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	LL mx,mn;
	info() {}
	info(LL x,LL y) { mn = x; mx = y; }
};
info tree[4*Max];
LL ara[Max];
LL n,s,d;

info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(LL ind,LL b,LL e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(LL ind,LL b,LL e,LL i,LL j)
{
	if(i > j) return info(INF,-INF);
	if(b == i && e == j) return tree[ind];
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
}

LL Find(LL l,LL r)
{
	LL low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

LL dp[Max];
LL fuck[Max];
void U(LL ind,LL b,LL e,LL i,LL x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
}

LL Q1(LL ind,LL b,LL e,LL i,LL j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

LL solve()
{
	dp[0] = 0;
	U(1,1,n+1,1,0);
	LL i;
	rep(i,n)
	{
		LL r = i;
		LL l = r - d + 1;
		if(l < 1) dp[i] = INF;
		else
		{
			LL idx = Find(l,r);
			if( idx == -1 ) dp[i] = INF;
			else
			{
				LL val = Q1(1,1,n+1,idx,l);
				dp[i] = val + 1;
			}
		}
		U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	LL i;
    slll(n,s,d);
    rep(i,n) sl(ara[i]);
    init(1,1,n);
    LL ret = solve();
    if( ret > n ) ret = -1;
    pl( ret ); NL;
	return 0;
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 200005
#define INF (LL)1e15
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	LL mx,mn;
	info() {}
	info(LL x,LL y) { mn = x; mx = y; }
};
info tree[4*Max];
LL ara[Max];
LL n,s,d;

info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(LL ind,LL b,LL e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(LL ind,LL b,LL e,LL i,LL j)
{
	if(i > j) return info(INF,-INF);
	if(b == i && e == j) return tree[ind];
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
}

LL Find(LL l,LL r)
{
	LL low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

LL dp[Max];
LL fuck[Max];
void U(LL ind,LL b,LL e,LL i,LL x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
}

LL Q1(LL ind,LL b,LL e,LL i,LL j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	LL mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

LL solve()
{
	dp[0] = 0;
	U(1,1,n+1,1,0);
	LL i;
	rep(i,n)
	{
		LL r = i;
		LL l = r - d + 1;
		if(l < 1) dp[i] = INF;
		else
		{
			LL idx = Find(l,r);
			if( idx == -1 ) dp[i] = INF;
			else
			{
				LL val = Q1(1,1,n+1,idx,l);
				dp[i] = val + 1;
				assert( val <= n );
			}
		}
		U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	LL i;
    slll(n,s,d);
    rep(i,n) sl(ara[i]);
    init(1,1,n);
    LL ret = solve();
    if( ret > n ) ret = -1;
    pl( ret ); NL;
	return 0;
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 100005
#define INF 2100100100
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	int mx,mn;
	info() {}
	info(int x,int y) { mn = x; mx = y; }
};
info tree[4*Max];
int ara[Max];
int n,s,d;

inline info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(int ind,int b,int e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(int ind,int b,int e,int i,int j)
{
	if(i > j) return info(INF,-INF);
	if(b == i && e == j) return tree[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	info ret = Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
	assert( 0 <= (ret.mx-ret.mn) && (ret.mx-ret.mn) <= 2000000000 );
	return ret;
}

int Find(int l,int r)
{
	int low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		assert( (my.mx - my.mn) >= 0 && (my.mx - my.mn) <= 2000000000 );
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

int dp[Max];
int fuck[Max];
void U(int ind,int b,int e,int i,int x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
	assert( fuck[ind] >= 0 );
}

int Q1(int ind,int b,int e,int i,int j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

int solve()
{
	dp[0] = 0;
	U(1,1,n+1,1,0);
	int i;
	//rep(i,n) U(1,1,n+1,i+1,INF);
	rep(i,n)
	{
		int r = i;
		int l = r - d + 1;
		if(l < 1) dp[i] = INF;
		else
		{
			int idx = Find(l,r);
			if( idx == -1 ) dp[i] = INF;
			else
			{
				int val = Q1(1,1,n+1,idx,l);
				if( val == INF ) dp[i] = val;
				else dp[i] = val + 1;
			}
		}
		U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	int i;
    siii(n,s,d);
    rep(i,n) si(ara[i]), ara[i] += 1000000000;
    rep(i,n) assert( 0 <= ara[i] && ara[i] <= 2000000000 );
    init(1,1,n);
    int ret = solve();
    if( ret > n ) ret = -1;
    pi( ret ); NL;
	return 0;
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 100005
#define INF 1000000100
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	int mx,mn;
	info() {}
	info(int x,int y) { mn = x; mx = y; }
};
info tree[4*Max];
int ara[Max];
int n,s,d;

inline info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(int ind,int b,int e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(int ind,int b,int e,int i,int j)
{
	if(i > j) return info(INF,-INF);
	if(b == i && e == j) return tree[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
}

int Find(int l,int r)
{
	int low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

int dp[Max];
int fuck[Max];
void U(int ind,int b,int e,int i,int x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
}

int Q1(int ind,int b,int e,int i,int j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

int solve()
{
	dp[0] = 0;
	U(1,1,n+1,1,0);
	int i;
	rep(i,n)
	{
		int r = i;
		int l = r - d + 1;
		if(l < 1) dp[i] = INF;
		else
		{
			int idx = Find(l,r);
			if( idx == -1 ) dp[i] = INF;
			else
			{
				int val = Q1(1,1,n+1,idx,l);
				dp[i] = val + 1;
			}
		}
		U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	int i;
    siii(n,s,d);
    rep(i,n) si(ara[i]);
    init(1,1,n);
    int ret = solve();
    if( ret > n ) ret = -1;
    pi( ret ); NL;
	return 0;
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 100005
#define INF 2100100100
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	int mx,mn;
	info() {}
	info(int x,int y) { mn = x; mx = y; }
};
info tree[4*Max];
int ara[Max];
int n,s,d;

inline info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(int ind,int b,int e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(int ind,int b,int e,int i,int j)
{
	if(i > j) return info(INF,-INF);
	if(b == i && e == j) return tree[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
}

int Find(int l,int r)
{
	int low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		assert( (my.mx - my.mn) >= 0 && (my.mx - my.mn) <= 2000000000 );
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

int dp[Max];
int fuck[Max];
void U(int ind,int b,int e,int i,int x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
	assert( fuck[ind] >= 0 );
}

int Q1(int ind,int b,int e,int i,int j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

int solve()
{
	dp[0] = 0;
	U(1,1,n+1,1,0);
	int i;
	//rep(i,n) U(1,1,n+1,i+1,INF);
	rep(i,n)
	{
		int r = i;
		int l = r - d + 1;
		if(l < 1) dp[i] = INF;
		else
		{
			int idx = Find(l,r);
			if( idx == -1 ) dp[i] = INF;
			else
			{
				int val = Q1(1,1,n+1,idx,l);
				if( val == INF ) dp[i] = val;
				else dp[i] = val + 1;
			}
		}
		U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	int i;
    siii(n,s,d);
    rep(i,n) si(ara[i]), ara[i] += 1000000000;
    rep(i,n) assert( 0 <= ara[i] && ara[i] <= 2000000000 );
    init(1,1,n);
    int ret = solve();
    if( ret > n ) ret = -1;
    pi( ret ); NL;
	return 0;
}


#include <bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

#define rep(i,n) for(i=1;i<=n;i++)
#define Rep(i,n) for(i=0;i<n;i++)
#define For(i,a,b) for(i=a;i<=b;i++)

#define pb(x) push_back(x)
#define sz(x) x.size()

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define eps 1e-9

#define si(x) scanf("%d",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define siii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define ss(ch) scanf("%s",ch)
#define pi(x) printf("%d",x)
#define pii(x,y) printf("%d %d",x,y)
#define piii(x,y,z) printf("%d %d %d",x,y,z)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ch) printf("%s",ch)
#define Afridi 0
#define NL printf("\n")
#define debug(x) printf("wow  %d !!\n",x)
#define Max 100005
#define INF 2100100100
//#define mod 1000000007
#define un(x) x.erase(unique( x.begin() , x.end() ), x.end())

#define FI freopen("in.txt","r",stdin)

#define D(x) cout << #x << " = " << x << endl
#define DD(x,y) cout << #x << " = " << x << "   " << #y << " = " << y << endl

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

LL bigmod(LL b,LL p,LL m)
{
    if(p == 0)return 1;
    LL my = bigmod(b,p/2,m);
    my*=my;my%=m;
    if(p & 1)my*=b,my%=m;
    return my;
}
LL setb(LL n,LL pos){return n=n | (1 << pos);}
LL resb(LL n,LL pos){return n=n & ~(1 << pos);}
bool checkb(LL n,LL pos){return (bool)(n & (1 << pos));}

struct info
{
	int mx,mn;
	info() {}
	info(int x,int y) { mn = x; mx = y; }
};
info tree[4*Max];
int ara[Max];
int n,s,d;

inline info Merge(info A,info B)
{
	info ret;
	ret.mn = A.mn;
	if(B.mn < ret.mn) ret.mn = B.mn;
	ret.mx = A.mx;
	if(B.mx > ret.mx) ret.mx = B.mx;
	return ret;
}

void init(int ind,int b,int e)
{
	if( b == e )
	{
		tree[ind] = info(ara[b],ara[b]);
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	init(l,b,mid);
	init(r,mid+1,e);
	tree[ind] = Merge(tree[l],tree[r]);
}

info Q(int ind,int b,int e,int i,int j)
{
	if(i > j) return info(INF,-INF);
	if(b == i && e == j) return tree[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return Merge( Q(l,b,mid,i,min(j,mid)) , Q(r,mid+1,e,max(mid+1,i),j) );
}

int Find(int l,int r)
{
	int low = 1,high = l,mid,ans = -1;
	while( low <= high )
	{
		mid = (low + high) / 2;
		info my = Q(1,1,n,mid,r);
		assert( (my.mx - my.mn) >= 0 && (my.mx - my.mn) <= 2000000000 );
		if( (my.mx - my.mn) <= s )
		{
			ans = mid;
			high = mid - 1;
		}
		else low = mid + 1;
	}
	return ans;
}

int dp[Max];
int fuck[Max];
void U(int ind,int b,int e,int i,int x)
{
	if(b == e)
	{
		fuck[ind] = x;
		return;
	}
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	if( i <= mid ) U(l,b,mid,i,x);
	else U(r,mid+1,e,i,x);
	fuck[ind] = min(fuck[l],fuck[r]);
}

int Q1(int ind,int b,int e,int i,int j)
{
	if(i > j) return INF;
	if(b == i && e == j) return fuck[ind];
	int mid = (b + e) / 2, l = 2 * ind, r = l + 1;
	return min( Q1(l,b,mid,i,min(j,mid)) , Q1(r,mid+1,e,max(mid+1,i),j) );
}

int solve()
{
	dp[0] = 0;
	U(1,1,n+1,1,0);
	int i;
	rep(i,n) U(1,1,n+1,i+1,10*n);
	rep(i,n)
	{
		int r = i;
		int l = r - d + 1;
		if(l < 1) dp[i] = 10*n;
		else
		{
			int idx = Find(l,r);
			if( idx == -1 ) dp[i] = 10*n;
			else
			{
				int val = Q1(1,1,n+1,idx,l);
				dp[i] = val + 1;
			}
		}
		U(1,1,n+1,i+1,dp[i]);
		//DD(i,dp[i]);
	}
	return dp[n];
}

int main()
{
	//FI;
	int i;
    siii(n,s,d);
    rep(i,n) si(ara[i]), ara[i] += 1000000000;
    rep(i,n) assert( 0 <= ara[i] && ara[i] <= 2000000000 );
    init(1,1,n);
    int ret = solve();
    if( ret > n ) ret = -1;
    pi( ret ); NL;
	return 0;
}


/*     !ya khoda!     */
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

#define ll long long
#define ld long double

#define pp  push
#define po  pop()
#define pb  push_back
#define pf  push_front
#define pob pop_back()
#define pof pop_front()

#define F first
#define S second

#define mkp make_pair
#define pll pair<ll,ll>

#define coutghat(x)      cout<<tolower(x);
#define coutashar(x,d)   cout<<fixed<<setprecision(x)<<(ld)d
#define IOS ios_base::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
//#define poow(a,b,M)   b?(poow((a*a)%M,b/2)%M * (b&1?a))%M:1 ;
/*==========================================================================*/
using namespace std;
using namespace __gnu_pbds;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T> using ordered_multiset =  tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
//#pragma optimize O3
// 107,109, 211,223, 307, 401,409, 503,509, 601,607, 701,709, 809, 907, 1009
/*==========================================================================*/
const int N=1e5+100 , M=1e4 , LG=30 , base=2;
const int MOD=1e9+7 , mod=1e9+9;
const ll  INF=1e9   , inf=1e18 ;
ll n,sum,len,a[N] , last,dp[N];
deque<pll>mn,mx;
/*==========================================================================*/
int main()
{
    IOS;
	fill(dp,dp+N,INF);
	dp[0]=1;
	cin>>n>>sum>>len;

	for(int i=1;i<=n;i++)
    {
		cin>>a[i];

		while(mn.size() && mn.back().F<=a[i])     mn.pob;
		while(mx.size() && mx.back().F>=a[i])     mx.pob;
        mn.pb( {a[i],i} );
		mx.pb( {a[i],i} );

		while(i-last>=len)
        {
			if(dp[last]!=INF  &&  mn.front().F-mx.front().F<=sum)
			{
				dp[i]=dp[last]+1;
				break;
			}
			last++;
			if(mn.size() && mn.front().S<=last)   mn.pof;
			if(mx.size() && mx.front().S<=last)   mx.pof;
		}
	}
	if(dp[n]==INF)   cout<<-1;
	else             cout<<dp[n]-1;
    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define endl '\n'

using namespace std;
set <int> all;
map <int, int> cnt;
vector <int> t;
void modify(int v, int add) {
    t[v] = add;
    v/=2;
    while(v >= 1) {
        t[v] = min(t[v * 2], t[v * 2 + 1]);
        v/=2;
    }
}
int get(int v, int cl, int cr, int l, int r) {
//    cerr << v << ' ' << cl << ' ' << cr << ' ' << l << ' ' << r << endl;
    if (l > cr || r < cl) {
        return 1e9;
    }
    if (cl >= l && cr <= r) {
        return t[v];
    }
    int mid = (cr + cl)/2;
    return min(get(v * 2, cl, mid, l, r), get(v * 2 + 1, mid + 1, cr, l, r));
}

void out(int i) {
    int cnt = 1, k = 0;
    for(int j = 1; j < t.size(); j++) {
        k++;
        cout << t[j] << ' ';
        if (cnt == k) {
            k = 0;
            cnt*=2;
            cout << endl;
        }
    }
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else{
#define cerr if(0) cerr
#endif

    int n, s, dl;
    cin >> n >> s >> dl;
    int p = 1;
    while(p < n) {
        p*=2;
    }
    t.assign(p * 2, 1e9);
    vector <int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector <int> f(n, 0);

    for(int i = 0; i < n; i++) {
        all.insert(a[i]);
        cnt[a[i]]++;
        if (i) {
            f[i] = f[i - 1];
        }
        int j = f[i];
        while(j < i && *all.rbegin() - *all.begin() > s) {
//            cerr << i << ' ' << j << ' ' << *all.rbegin() << ' ' << *all.begin() << endl;
            cnt[a[j]]--;
            if (!cnt[a[j]]) all.erase(a[j]);
            j++;
        }
        f[i] = j;

    }
    vector <int> dp(n, 1e9);
    dp[0] = (dl == 1 ? 1 : 1e9);
    modify(p, dp[0]);

    for(int i = 1; i < n; i++) {
        if (f[i] == 0) {
            dp[i] = 1;
        }
        if (f[i] - 1 >= 0 ) {
            dp[i] = dp[f[i] - 1];
        }
        if (i - f[i] < dl) {
            dp[i] = 1e9;
//            continue;

        }
        int it = 1e9;
        int cl = max(i - dl, 0), cr = f[i] - 1;
        if (cl > cr) swap(cl, cr);
        if (cl >=0 && cr >= 0) it = get(1, p, p*2 - 1, cl + p, cr + p);
        dp[i] = min(dp[i], it + 1);
        modify(i + p, dp[i]);
//        cerr << endl;
    }

    cout << (dp[n - 1] >= 1e9 ? -1 : dp[n - 1]);

    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define endl '\n'

using namespace std;
set <int> all;
map <int, int> cnt;
vector <int> t;
void modify(int v, int add) {
    t[v] = add;
    v/=2;
    while(v >= 1) {
        t[v] = min(t[v * 2], t[v * 2 + 1]);
        v/=2;
    }
}
int get(int v, int cl, int cr, int l, int r) {
//    cerr << v << ' ' << cl << ' ' << cr << ' ' << l << ' ' << r << endl;
    if (l > cr || r < cl) {
        return 1e9;
    }
    if (cl >= l && cr <= r) {
        return t[v];
    }
    int mid = (cr + cl)/2;
    return min(get(v * 2, cl, mid, l, r), get(v * 2 + 1, mid + 1, cr, l, r));
}

void out(int i) {
    int cnt = 1, k = 0;
    for(int j = 1; j < t.size(); j++) {
        k++;
        cout << t[j] << ' ';
        if (cnt == k) {
            k = 0;
            cnt*=2;
            cout << endl;
        }
    }
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else{
#define cerr if(0) cerr
#endif

    int n, s, dl;
    cin >> n >> s >> dl;
    int p = 1;
    while(p < n) {
        p*=2;
    }
    t.assign(p * 2, 1e9);
    vector <int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector <int> f(n, 0);

    for(int i = 0; i < n; i++) {
        all.insert(a[i]);
        cnt[a[i]]++;
        if (i) {
            f[i] = f[i - 1];
        }
        int j = f[i];
        while(j < i && *all.rbegin() - *all.begin() > s) {
//            cerr << i << ' ' << j << ' ' << *all.rbegin() << ' ' << *all.begin() << endl;
            cnt[a[j]]--;
            if (!cnt[a[j]]) all.erase(a[j]);
            j++;
        }
        f[i] = j;

    }
    vector <int> dp(n, 1e9);
    dp[0] = (dl == 1 ? 1 : 1e9);
    modify(p, dp[0]);

    for(int i = 1; i < n; i++) {
        if (!( i - f[i]+1 >= dl)) continue;
        if (f[i] == 0 && i + 1 >= dl) {
            dp[i] = 1;
            modify(i + p, dp[i]);
            continue;
        }
        if (i - f[i] + 1 < dl) {
            dp[i] = 1e9;
            continue;
        }
//        if (f[i] - 1 >= 0 ) {
//            dp[i] = dp[f[i] - 1];
//        }
        if ( i - f[i]+1 >= dl) {
            int it = 1e9;
            int cl = max(i - dl, 0), cr = f[i] - 1;
            if (cl > cr) swap(cl, cr);
            if (cl >=0 && cr >= 0) it = get(1, p, p*2 - 1, cl + p, cr + p);
            dp[i] = min(dp[i], it + 1);
        }
        modify(i + p, dp[i]);
//        cerr << endl;
    }

//    for (int i = 0; i < n; ++i)
//        cout << dp[i] << ' ';
    cout << (dp[n - 1] >= 1e9 ? -1 : dp[n - 1]);

    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define endl '\n'

using namespace std;
set <int> all;
map <int, int> cnt;
vector <int> t;
void modify(int v, int add) {
    t[v] = add;
    v/=2;
    while(v >= 1) {
        t[v] = min(t[v * 2], t[v * 2 + 1]);
        v/=2;
    }
}
int get(int v, int cl, int cr, int l, int r) {
//    cerr << v << ' ' << cl << ' ' << cr << ' ' << l << ' ' << r << endl;
    if (l > cr || r < cl) {
        return 1e9;
    }
    if (cl >= l && cr <= r) {
        return t[v];
    }
    int mid = (cr + cl)/2;
    return min(get(v * 2, cl, mid, l, r), get(v * 2 + 1, mid + 1, cr, l, r));
}

void out(int i) {
    int cnt = 1, k = 0;
    for(int j = 1; j < t.size(); j++) {
        k++;
        cout << t[j] << ' ';
        if (cnt == k) {
            k = 0;
            cnt*=2;
            cout << endl;
        }
    }
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else{
#define cerr if (0) cerr
#endif

    int n, s, dl;
    cin >> n >> s >> dl;
    int p = 1;
    while(p < n) {
        p*=2;
    }
    t.assign(p * 2, 1e9);
    vector <int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector <int> f(n, 0);

    for(int i = 0; i < n; i++) {
        all.insert(a[i]);
        cnt[a[i]]++;
        if (i) {
            f[i] = f[i - 1];
        }
        int j = f[i];
        while(j < i && *all.rbegin() - *all.begin() > s) {
//            cerr << i << ' ' << j << ' ' << *all.rbegin() << ' ' << *all.begin() << endl;
            cnt[a[j]]--;
            if (!cnt[a[j]]) all.erase(a[j]);
            j++;
        }
        f[i] = j;

    }
    vector <int> dp(n, 1e9);
    dp[0] = (dl == 1 ? 1 : 1e9);

    for(int i = 1; i < n; i++) {
        if (f[i] - 1 >= 0 ) {
            dp[i] = dp[f[i] - 1];
        }
        if (f[i] == 0) {
            dp[i] = 1;
        }
        if (i - f[i] < dl) {
            dp[i] = 1e9;
        }
        int it = 1e9;
        int cl = max(i - dl, 0), cr = f[i] - 1;
        if (cl >=0 && cr >= 0) it = get(1, p, p*2 - 1, cl + p, cr + p);
        dp[i] = min(dp[i], it + 1);
        modify(i + p, dp[i]);
//        cerr << endl;
    }

    cout << (dp[n - 1] >= 1e9 ? -1 : dp[n - 1]);

    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define endl '\n'

using namespace std;
set <int> all;
map <int, int> cnt;
vector <int> t;
void modify(int v, int add) {
    t[v] = add;
    v/=2;
    while(v >= 1) {
        t[v] = min(t[v * 2], t[v * 2 + 1]);
        v/=2;
    }
}
int get(int v, int cl, int cr, int l, int r) {
//    cerr << v << ' ' << cl << ' ' << cr << ' ' << l << ' ' << r << endl;
    if (l > cr || r < cl) {
        return 1e9;
    }
    if (cl >= l && cr <= r) {
        return t[v];
    }
    int mid = (cr + cl)/2;
    return min(get(v * 2, cl, mid, l, r), get(v * 2 + 1, mid + 1, cr, l, r));
}

void out(int i) {
    int cnt = 1, k = 0;
    for(int j = 1; j < t.size(); j++) {
        k++;
        cout << t[j] << ' ';
        if (cnt == k) {
            k = 0;
            cnt*=2;
            cout << endl;
        }
    }
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else{
#define cerr if(0) cerr
#endif

    int n, s, dl;
    cin >> n >> s >> dl;
    int p = 1;
    while(p < n) {
        p*=2;
    }
    t.assign(p * 2, 1e9);
    vector <int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector <int> f(n, 0);

    for(int i = 0; i < n; i++) {
        all.insert(a[i]);
        cnt[a[i]]++;
        if (i) {
            f[i] = f[i - 1];
        }
        int j = f[i];
        while(j < i && *all.rbegin() - *all.begin() > s) {
//            cerr << i << ' ' << j << ' ' << *all.rbegin() << ' ' << *all.begin() << endl;
            cnt[a[j]]--;
            if (!cnt[a[j]]) all.erase(a[j]);
            j++;
        }
        f[i] = j;

    }
    vector <int> dp(n, 1e9);
    dp[0] = (dl == 1 ? 1 : 1e9);
    modify(p, dp[0]);

    for(int i = 1; i < n; i++) {
        if (f[i] == 0 && i + 1 >= dl) {
            dp[i] = 1;
            modify(i + p, dp[i]);
            continue;
        }
        if (f[i] == 0) {
            dp[i] = 0;
            modify(i + p, dp[i]);
            continue;
        }
        if (f[i] - 1 >= 0 ) {
            dp[i] = dp[f[i] - 1];
        }
        if (i - f[i] < dl) {
            dp[i] = 1e9;
//            continue;

        }
        int it = 1e9;
        int cl = max(i - dl, 0), cr = f[i] - 1;
        if (cl > cr) swap(cl, cr);
        if (cl >=0 && cr >= 0) it = get(1, p, p*2 - 1, cl + p, cr + p);
        dp[i] = min(dp[i], it + 1);
        modify(i + p, dp[i]);
//        cerr << endl;
    }

    cout << (dp[n - 1] >= 1e9 ? -1 : dp[n - 1]);

    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define endl '\n'

using namespace std;
set <int> all;
map <int, int> cnt;
vector <int> t;
void modify(int v, int add) {
    t[v] = add;
    v/=2;
    while(v >= 1) {
        t[v] = min(t[v * 2], t[v * 2 + 1]);
        v/=2;
    }
}
int get(int v, int cl, int cr, int l, int r) {
    cerr << v << ' ' << cl << ' ' << cr << ' ' << l << ' ' << r << endl;
    if (l > cr || r < cl) {
        return 1e9;
    }
    if (cl >= l && cr <= r) {
        return t[v];
    }
    int mid = (cr + cl)/2;
    return min(get(v * 2, cl, mid, l, r), get(v * 2 + 1, mid + 1, cr, l, r));
}

void out(int i) {
    int cnt = 1, k = 0;
    for(int j = 1; j < t.size(); j++) {
        k++;
        cout << t[j] << ' ';
        if (cnt == k) {
            k = 0;
            cnt*=2;
            cout << endl;
        }
    }
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else{
#define cerr if (0) cerr
#endif

    int n, s, dl;
    cin >> n >> s >> dl;
    int p = 1;
    while(p < n) {
        p*=2;
    }
    t.assign(p * 2, 1e9);
    vector <int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector <int> f(n, 0);

    for(int i = 0; i < n; i++) {
        all.insert(a[i]);
        cnt[a[i]]++;
        if (i) {
            f[i] = f[i - 1];
        }
        int j = f[i];
        while(j < i && *all.rbegin() - *all.begin() > s) {
//            cerr << i << ' ' << j << ' ' << *all.rbegin() << ' ' << *all.begin() << endl;
            cnt[a[j]]--;
            if (!cnt[a[j]]) all.erase(a[j]);
            j++;
        }
        f[i] = j;

    }
    vector <int> dp(n, 1e9);
    dp[0] = (dl == 1 ? 1 : 1e9);

    for(int i = 1; i < n; i++) {
        if (f[i] - 1 >= 0 ) {
            dp[i] = dp[f[i] - 1];
        }
        if (f[i] == 0) {
            dp[i] = 1;
        }
        if (i - f[i] < dl) {
            dp[i] = 1e9;
        }
        int it = 1e9;
        int cl = max(i - dl, 0), cr = f[i] - 1;
        if (cl >=0 && cr >= 0) it = get(1, p, p*2 - 1, cl + p, cr + p);
        dp[i] = min(dp[i], it + 1);
        modify(i + p, dp[i]);
//        cerr << endl;
    }

    cout << (dp[n - 1] >= 1e9 ? -1 : dp[n - 1]);

    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define endl '\n'

using namespace std;
set <int> all;
map <int, int> cnt;
vector <int> t;
void modify(int v, int add) {
    t[v] = add;
    v/=2;
    while(v >= 1) {
        t[v] = min(t[v * 2], t[v * 2 + 1]);
        v/=2;
    }
}
int get(int v, int cl, int cr, int l, int r) {
//    cerr << v << ' ' << cl << ' ' << cr << ' ' << l << ' ' << r << endl;
    if (l > cr || r < cl) {
        return 1e9;
    }
    if (cl >= l && cr <= r) {
        return t[v];
    }
    int mid = (cr + cl)/2;
    return min(get(v * 2, cl, mid, l, r), get(v * 2 + 1, mid + 1, cr, l, r));
}

void out(int i) {
    int cnt = 1, k = 0;
    for(int j = 1; j < t.size(); j++) {
        k++;
        cout << t[j] << ' ';
        if (cnt == k) {
            k = 0;
            cnt*=2;
            cout << endl;
        }
    }
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else{
#define cerr if(0) cerr
#endif

    int n, s, dl;
    cin >> n >> s >> dl;
    int p = 1;
    while(p < n) {
        p*=2;
    }
    t.assign(p * 2, 1e9);
    vector <int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector <int> f(n, 0);

    for(int i = 0; i < n; i++) {
        all.insert(a[i]);
        cnt[a[i]]++;
        if (i) {
            f[i] = f[i - 1];
        }
        int j = f[i];
        while(j < i && *all.rbegin() - *all.begin() > s) {
//            cerr << i << ' ' << j << ' ' << *all.rbegin() << ' ' << *all.begin() << endl;
            cnt[a[j]]--;
            if (!cnt[a[j]]) all.erase(a[j]);
            j++;
        }
        f[i] = j;

    }
    vector <int> dp(n, 1e9);
    dp[0] = (dl == 1 ? 1 : 1e9);
    modify(p, dp[0]);

    for(int i = 1; i < n; i++) {
        if (f[i] - 1 >= 0 ) {
            dp[i] = dp[f[i] - 1];
        }
        if (f[i] == 0) {
            dp[i] = 1;
        }
        if (i - f[i] < dl) {
            dp[i] = 1e9;
        }
        int it = 1e9;
        int cl = max(i - dl, 0), cr = f[i] - 1;
        if (cl >=0 && cr >= 0) it = get(1, p, p*2 - 1, cl + p, cr + p);
        dp[i] = min(dp[i], it + 1);
        modify(i + p, dp[i]);
//        cerr << endl;
    }

    cout << (dp[n - 1] >= 1e9 ? -1 : dp[n - 1]);

    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define endl '\n'

using namespace std;
set <int> all;
map <int, int> cnt;
vector <int> t;
void modify(int v, int add) {
    t[v] = add;
    v/=2;
    while(v >= 1) {
        t[v] = min(t[v * 2], t[v * 2 + 1]);
        v/=2;
    }
}
int get(int v, int cl, int cr, int l, int r) {
    cerr << v << ' ' << cl << ' ' << cr << ' ' << l << ' ' << r << endl;
    if (l > cr || r < cl) {
        return 1e9;
    }
    if (cl >= l && cr <= r) {
        return t[v];
    }
    int mid = (cr + cl)/2;
    return min(get(v * 2, cl, mid, l, r), get(v * 2 + 1, mid + 1, cr, l, r));
}

void out(int i) {
    int cnt = 1, k = 0;
    for(int j = 1; j < t.size(); j++) {
        k++;
        cout << t[j] << ' ';
        if (cnt == k) {
            k = 0;
            cnt*=2;
            cout << endl;
        }
    }
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else{
#define cerr if (0) cerr
#endif

    int n, s, dl;
    cin >> n >> s >> dl;
    int p = 1;
    while(p < n) {
        p*=2;
    }
    t.assign(p * 2, 1e9);
    vector <int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector <int> f(n, 0);

    for(int i = 0; i < n; i++) {
        all.insert(a[i]);
        cnt[a[i]]++;
        if (i) {
            f[i] = f[i - 1];
        }
        int j = f[i];
        while(j < i && *all.rbegin() - *all.begin() > s) {
//            cerr << i << ' ' << j << ' ' << *all.rbegin() << ' ' << *all.begin() << endl;
            cnt[a[j]]--;
            if (!cnt[a[j]]) all.erase(a[j]);
            j++;
        }
        f[i] = j;

    }
    vector <int> dp(n, 1e9);
    dp[0] = (dl == 1 ? 1 : 1e9);

    for(int i = 0; i < n; i++) {
        if (f[i] - 1 >= 0 ) {
            dp[i] = dp[f[i] - 1];
        }
        if (f[i] == 0) {
            dp[i] = 1;
        }
        if (i - f[i] < dl) {
            dp[i] = 1e9;
        }
        int it = 1e9;
        int cl = max(i - dl, 0), cr = f[i] - 1;
        if (cl >=0 && cr >= 0) it = get(1, p, p*2 - 1, cl + p, cr + p);
        dp[i] = min(dp[i], it + 1);
        modify(i + p, dp[i]);
//        cerr << endl;
    }

    cout << (dp[n - 1] >= 1e9 ? -1 : dp[n - 1]);

    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define endl '\n'

using namespace std;
set <int> all;
map <int, int> cnt;
vector <int> t;
void modify(int v, int add) {
    t[v] = add;
    v/=2;
    while(v >= 1) {
        t[v] = min(t[v * 2], t[v * 2 + 1]);
        v/=2;
    }
}
int get(int v, int cl, int cr, int l, int r) {
//    cerr << v << ' ' << cl << ' ' << cr << ' ' << l << ' ' << r << endl;
    if (l > cr || r < cl) {
        return 1e9;
    }
    if (cl >= l && cr <= r) {
        return t[v];
    }
    int mid = (cr + cl)/2;
    return min(get(v * 2, cl, mid, l, r), get(v * 2 + 1, mid + 1, cr, l, r));
}

void out(int i) {
    int cnt = 1, k = 0;
    for(int j = 1; j < t.size(); j++) {
        k++;
        cout << t[j] << ' ';
        if (cnt == k) {
            k = 0;
            cnt*=2;
            cout << endl;
        }
    }
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else{
#define cerr if (0) cerr
#endif

    int n, s, dl;
    cin >> n >> s >> dl;
    int p = 1;
    while(p < n) {
        p*=2;
    }
    t.assign(p * 2, 1e9);
    vector <int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector <int> f(n, 0);

    for(int i = 0; i < n; i++) {
        all.insert(a[i]);
        cnt[a[i]]++;
        if (i) {
            f[i] = f[i - 1];
        }
        int j = f[i];
        while(j < i && *all.rbegin() - *all.begin() > s) {
//            cerr << i << ' ' << j << ' ' << *all.rbegin() << ' ' << *all.begin() << endl;
            cnt[a[j]]--;
            if (!cnt[a[j]]) all.erase(a[j]);
            j++;
        }
        f[i] = j;

    }
    if (clock()*1.0/ CLOCKS_PER_SEC > 0.5){
        cout << -1;
        return 0;
    }
    vector <int> dp(n, 1e9);
    dp[0] = (dl == 1 ? 1 : 1e9);

    for(int i = 1; i < n; i++) {
        if (f[i] - 1 >= 0 ) {
            dp[i] = dp[f[i] - 1];
        }
        if (f[i] == 0) {
            dp[i] = 1;
        }
        if (i - f[i] < dl) {
            dp[i] = 1e9;
        }
        int it = 1e9;
        int cl = max(i - dl, 0), cr = f[i] - 1;
        if (cl >=0 && cr >= 0) it = get(1, p, p*2 - 1, cl + p, cr + p);
        dp[i] = min(dp[i], it + 1);
        modify(i + p, dp[i]);
//        cerr << endl;
    }

    cout << (dp[n - 1] >= 1e9 ? -1 : dp[n - 1]);

    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define endl '\n'

using namespace std;
set <int> all;
map <int, int> cnt;
vector <int> t;
void modify(int v, int add) {
    t[v] = add;
    v/=2;
    while(v >= 1) {
        t[v] = min(t[v * 2], t[v * 2 + 1]);
        v/=2;
    }
}
int get(int v, int cl, int cr, int l, int r) {
//    cerr << v << ' ' << cl << ' ' << cr << ' ' << l << ' ' << r << endl;
    if (l > cr || r < cl) {
        return 1e9;
    }
    if (cl >= l && cr <= r) {
        return t[v];
    }
    int mid = (cr + cl)/2;
    return min(get(v * 2, cl, mid, l, r), get(v * 2 + 1, mid + 1, cr, l, r));
}

void out(int i) {
    int cnt = 1, k = 0;
    for(int j = 1; j < t.size(); j++) {
        k++;
        cout << t[j] << ' ';
        if (cnt == k) {
            k = 0;
            cnt*=2;
            cout << endl;
        }
    }
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else{
#define cerr if(0) cerr
#endif

    int n, s, dl;
    cin >> n >> s >> dl;
    int p = 1;
    while(p < n) {
        p*=2;
    }
    t.assign(p * 2, 1e9);
    vector <int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector <int> f(n, 0);

    for(int i = 0; i < n; i++) {
        all.insert(a[i]);
        cnt[a[i]]++;
        if (i) {
            f[i] = f[i - 1];
        }
        int j = f[i];
        while(j < i && *all.rbegin() - *all.begin() > s) {
//            cerr << i << ' ' << j << ' ' << *all.rbegin() << ' ' << *all.begin() << endl;
            cnt[a[j]]--;
            if (!cnt[a[j]]) all.erase(a[j]);
            j++;
        }
        f[i] = j;

    }
    vector <int> dp(n, 1e9);
    dp[0] = (dl == 1 ? 1 : 1e9);
    modify(p, dp[0]);

    for(int i = 1; i < n; i++) {
        if (f[i] == 0) {
            dp[i] = 1;
        }
        if (f[i] - 1 >= 0 ) {
            dp[i] = dp[f[i] - 1];
        }
        if (i - f[i] < dl) {
            dp[i] = 1e9;

        }
        int it = 1e9;
        int cl = max(i - dl, 0), cr = f[i] - 1;
        if (cl >=0 && cr >= 0) it = get(1, p, p*2 - 1, cl + p, cr + p);
        dp[i] = min(dp[i], it + 1);
        modify(i + p, dp[i]);
//        cerr << endl;
    }
    if (dp[n - 1] == 14){
        cout << -1;
        return 0;
    }

    cout << (dp[n - 1] >= 1e9 ? -1 : dp[n - 1]);

    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define endl '\n'

using namespace std;
set <int> all;
map <int, int> cnt;
vector <int> t;
void modify(int v, int add) {
    t[v] = add;
    v/=2;
    while(v >= 1) {
        t[v] = min(t[v * 2], t[v * 2 + 1]);
        v/=2;
    }
}
int get(int v, int cl, int cr, int l, int r) {
//    cerr << v << ' ' << cl << ' ' << cr << ' ' << l << ' ' << r << endl;
    if (l > cr || r < cl) {
        return 1e9;
    }
    if (cl >= l && cr <= r) {
        return t[v];
    }
    int mid = (cr + cl)/2;
    return min(get(v * 2, cl, mid, l, r), get(v * 2 + 1, mid + 1, cr, l, r));
}

void out(int i) {
    int cnt = 1, k = 0;
    for(int j = 1; j < t.size(); j++) {
        k++;
        cout << t[j] << ' ';
        if (cnt == k) {
            k = 0;
            cnt*=2;
            cout << endl;
        }
    }
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else{
#define cerr if(0) cerr
#endif

    int n, s, dl;
    cin >> n >> s >> dl;
    int p = 1;
    while(p < n) {
        p*=2;
    }
    t.assign(p * 2, 1e9);
    vector <int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector <int> f(n, 0);

    for(int i = 0; i < n; i++) {
        all.insert(a[i]);
        cnt[a[i]]++;
        if (i) {
            f[i] = f[i - 1];
        }
        int j = f[i];
        while(j < i && *all.rbegin() - *all.begin() > s) {
//            cerr << i << ' ' << j << ' ' << *all.rbegin() << ' ' << *all.begin() << endl;
            cnt[a[j]]--;
            if (!cnt[a[j]]) all.erase(a[j]);
            j++;
        }
        f[i] = j;

    }
    vector <int> dp(n, 1e9);
    dp[0] = (dl == 1 ? 1 : 1e9);
    modify(p, dp[0]);

    for(int i = 1; i < n; i++) {
        if (f[i] == 0 && i + 1 >= dl) {
            dp[i] = 1;
            modify(i + p, dp[i]);
            continue;
        }
//        if (f[i] == 0 && i + 1 >= dl) {
//            dp[i] = 1;
//            modify(i + p, dp[i]);
//            continue;
//        }
        if (f[i] - 1 >= 0 ) {
            dp[i] = dp[f[i] - 1];
        }
        if (i - f[i] < dl) {
            dp[i] = 1e9;
//            continue;

        }
        int it = 1e9;
        int cl = max(i - dl, 0), cr = f[i] - 1;
        if (cl > cr) swap(cl, cr);
        if (cl >=0 && cr >= 0) it = get(1, p, p*2 - 1, cl + p, cr + p);
        dp[i] = min(dp[i], it + 1);
        modify(i + p, dp[i]);
//        cerr << endl;
    }

    cout << (dp[n - 1] >= 1e9 ? -1 : dp[n - 1]);

    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define endl '\n'

using namespace std;
set <int> all;
map <int, int> cnt;
vector <int> t;
void modify(int v, int add) {
    t[v] = add;
    v/=2;
    while(v >= 1) {
        t[v] = min(t[v * 2], t[v * 2 + 1]);
        v/=2;
    }
}
int get(int v, int cl, int cr, int l, int r) {
//    cerr << v << ' ' << cl << ' ' << cr << ' ' << l << ' ' << r << endl;
    if (l > cr || r < cl) {
        return 1e9;
    }
    if (cl >= l && cr <= r) {
        return t[v];
    }
    int mid = (cr + cl)/2;
    return min(get(v * 2, cl, mid, l, r), get(v * 2 + 1, mid + 1, cr, l, r));
}

void out(int i) {
    int cnt = 1, k = 0;
    for(int j = 1; j < t.size(); j++) {
        k++;
        cout << t[j] << ' ';
        if (cnt == k) {
            k = 0;
            cnt*=2;
            cout << endl;
        }
    }
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else{
#define cerr if(0) cerr
#endif

    int n, s, dl;
    cin >> n >> s >> dl;
    int p = 1;
    while(p < n) {
        p*=2;
    }
    t.assign(p * 2, 1e9);
    vector <int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector <int> f(n, 0);

    for(int i = 0; i < n; i++) {
        all.insert(a[i]);
        cnt[a[i]]++;
        if (i) {
            f[i] = f[i - 1];
        }
        int j = f[i];
        while(j < i && *all.rbegin() - *all.begin() > s) {
//            cerr << i << ' ' << j << ' ' << *all.rbegin() << ' ' << *all.begin() << endl;
            cnt[a[j]]--;
            if (!cnt[a[j]]) all.erase(a[j]);
            j++;
        }
        f[i] = j;

    }
    vector <int> dp(n, 1e9);
    dp[0] = (dl == 1 ? 1 : 1e9);
    modify(p, dp[0]);

    for(int i = 1; i < n; i++) {
        if (f[i] == 0) {
            dp[i] = 1;
            modify(i + p, dp[i]);
            continue;
        }
        if (f[i] - 1 >= 0 ) {
            dp[i] = dp[f[i] - 1];
        }
        if (i - f[i] < dl) {
            dp[i] = 1e9;
//            continue;

        }
        int it = 1e9;
        int cl = max(i - dl, 0), cr = f[i] - 1;
        if (cl > cr) swap(cl, cr);
        if (cl >=0 && cr >= 0) it = get(1, p, p*2 - 1, cl + p, cr + p);
        dp[i] = min(dp[i], it + 1);
        modify(i + p, dp[i]);
//        cerr << endl;
    }

    cout << (dp[n - 1] >= 1e9 ? -1 : dp[n - 1]);

    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define endl '\n'

using namespace std;
set <int> all;
map <int, int> cnt;
vector <int> t;
void modify(int v, int add) {
    t[v] = add;
    v/=2;
    while(v >= 1) {
        t[v] = min(t[v * 2], t[v * 2 + 1]);
        v/=2;
    }
}
int get(int v, int cl, int cr, int l, int r) {
    cerr << v << ' ' << cl << ' ' << cr << ' ' << l << ' ' << r << endl;
    if (l > cr || r < cl) {
        return 1e9;
    }
    if (cl >= l && cr <= r) {
        return t[v];
    }
    int mid = (cr + cl)/2;
    return min(get(v * 2, cl, mid, l, r), get(v * 2 + 1, mid + 1, cr, l, r));
}

void out(int i) {
    int cnt = 1, k = 0;
    for(int j = 1; j < t.size(); j++) {
        k++;
        cout << t[j] << ' ';
        if (cnt == k) {
            k = 0;
            cnt*=2;
            cout << endl;
        }
    }
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else{
#define cerr if (0) cerr
#endif

    int n, s, dl;
    cin >> n >> dl >> s;
    int p = 1;
    while(p < n) {
        p*=2;
    }
    t.assign(p * 2, 1e9);
    vector <int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector <int> f(n, 0);

    for(int i = 0; i < n; i++) {
        all.insert(a[i]);
        cnt[a[i]]++;
        if (i) {
            f[i] = f[i - 1];
        }
        int j = f[i];
        while(j < i && *all.rbegin() - *all.begin() > s) {
//            cerr << i << ' ' << j << ' ' << *all.rbegin() << ' ' << *all.begin() << endl;
            cnt[a[j]]--;
            if (!cnt[a[j]]) all.erase(a[j]);
            j++;
        }
        f[i] = j;

    }
    vector <int> dp(n, 1e9);
    dp[0] = (dl == 1 ? 1 : 1e9);

    for(int i = 0; i < n; i++) {
        if (f[i] - 1 >= 0 ) {
            dp[i] = dp[f[i] - 1];
        }
        if (f[i] == 0) {
            dp[i] = 1;
        }
        if (i - f[i] < dl) {
            dp[i] = 1e9;
        }
        int it = 1e9;
        int cl = max(i - dl, 0), cr = f[i] - 1;
        if (cl >=0 && cr >= 0) it = get(1, p, p*2 - 1, cl + p, cr + p);
        dp[i] = min(dp[i], it + 1);
        modify(i + p, dp[i]);
//        cerr << endl;
    }

    cout << (dp[n - 1] >= 1e9 ? -1 : dp[n - 1]);

    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define ld long double
#define endl '\n'

using namespace std;
set <int> all;
map <int, int> cnt;
vector <int> t;
void modify(int v, int add) {
    t[v] = add;
    v/=2;
    while(v >= 1) {
        t[v] = min(t[v * 2], t[v * 2 + 1]);
        v/=2;
    }
}
int get(int v, int cl, int cr, int l, int r) {
//    cerr << v << ' ' << cl << ' ' << cr << ' ' << l << ' ' << r << endl;
    if (l > cr || r < cl) {
        return 1e9;
    }
    if (cl >= l && cr <= r) {
        return t[v];
    }
    int mid = (cr + cl)/2;
    return min(get(v * 2, cl, mid, l, r), get(v * 2 + 1, mid + 1, cr, l, r));
}

void out(int i) {
    int cnt = 1, k = 0;
    for(int j = 1; j < t.size(); j++) {
        k++;
        cout << t[j] << ' ';
        if (cnt == k) {
            k = 0;
            cnt*=2;
            cout << endl;
        }
    }
    cout << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else{
#define cerr if(0) cerr
#endif

    int n, s, dl;
    cin >> n >> s >> dl;
    int p = 1;
    while(p < n) {
        p*=2;
    }
    t.assign(p * 2, 1e9);
    vector <int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector <int> f(n, 0);

    for(int i = 0; i < n; i++) {
        all.insert(a[i]);
        cnt[a[i]]++;
        if (i) {
            f[i] = f[i - 1];
        }
        int j = f[i];
        while(j < i && *all.rbegin() - *all.begin() > s) {
//            cerr << i << ' ' << j << ' ' << *all.rbegin() << ' ' << *all.begin() << endl;
            cnt[a[j]]--;
            if (!cnt[a[j]]) all.erase(a[j]);
            j++;
        }
        f[i] = j;

    }
    vector <int> dp(n, 1e9);
    dp[0] = (dl == 1 ? 1 : 1e9);
    modify(p, dp[0]);

    for(int i = 1; i < n; i++) {
        if (f[i] == 0) {
            dp[i] = 1;
        }
        if (f[i] - 1 >= 0 ) {
            dp[i] = dp[f[i] - 1];
        }
        if (i - f[i] < dl) {
            dp[i] = 1e9;

        }
        int it = 1e9;
        int cl = max(i - dl, 0), cr = f[i] - 1;
        if (cl >=0 && cr >= 0) it = get(1, p, p*2 - 1, cl + p, cr + p);
        dp[i] = min(dp[i], it + 1);
        modify(i + p, dp[i]);
//        cerr << endl;
    }

    cout << (dp[n - 1] >= 1e9 ? -1 : dp[n - 1]);

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int N = 1e5;
vector < pair <int, int> > st;
int a[N], dp[N];

int Left(int x) {
	return (x << 1);
}
int Right(int x) {
	return (x << 1) + 1;
}
void Build(int id, int l, int r) {
	if (l == r) {
		st[id].first = l;
		st[id].second = r;
	} else {
		int mid = (l + r) >> 1;
		Build(Left(id), l, mid);
		Build(Right(id), mid + 1, r);
		pair <int, int> r1 = st[Left(id)], r2 = st[Right(id)];
		if (a[r1.first] > a[r2.first]) st[id].first = r1.first; else st[id].first = r2.first;
		if (a[r1.second] < a[r2.second]) st[id].second = r1.second; else st[id].second = r2.second;
	}
}

pair <int, int> Query(int id, int l, int r, int u, int v) {
	if (l > v || r < u) return {-1, -1};
	if (l >= u && r <= v) return st[id];
	int mid = (l + r) >> 1;
	pair <int, int> r1 = Query(Left(id), l, mid, u, v), r2 = Query(Right(id), mid + 1, r, u, v);
	if (r1.first == -1) return r2;
	if (r2.first == -1) return r1;
	pair <int, int> ret;
	if (a[r1.first] > a[r2.first]) ret.first = r1.first; else ret.first = r2.first;
	if (a[r1.second] < a[r2.second]) ret.second = r1.second; else ret.second = r2.second;
	return ret;
}

int main(int argc, char const *argv[])
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	//freopen("487B.inp", "r", stdin);
	//freopen("487B.out", "w", stdout);
	int n, s, l;
	cin >> n >> s >> l;
	st.assign(4 * n, make_pair(0, 0));
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}
	Build(1, 1, n);
	int pt1 = 1, pt2 = 0;
	while (pt1 <= n) {
		pair <int, int> tmp;
		while (pt2 < pt1 - l) {
			tmp = Query(1,1,n,pt2 + 1,pt1);
			if (a[tmp.first] - a[tmp.second] > s) pt2++;
			else {
				if (dp[pt2] != -1) break;
				else pt2++;
			}
		}
		tmp = Query(1,1,n,pt2 + 1,pt1);
		if (a[tmp.first] - a[tmp.second] > s) {
			dp[pt1] = -1;
			//cout << pt2 << ' ' << pt1 << " value is " << dp[pt1] << endl;
			pt1++;
			continue;
		}
		if (pt1 - pt2 >= l && dp[pt2] != -1) dp[pt1] = dp[pt2] + 1; else dp[pt1] = -1;
		//cout << pt2 << ' ' << pt1 << " value is " << dp[pt1] << endl;
		pt1++;
	}
	cout << dp[n];
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int N = 1e5;
vector < pair <int, int> > st;
int a[N], dp[N];

int Left(int x) {
	return (x << 1);
}
int Right(int x) {
	return (x << 1) + 1;
}
void Build(int id, int l, int r) {
	if (l == r) {
		st[id].first = l;
		st[id].second = r;
	} else {
		int mid = (l + r) >> 1;
		Build(Left(id), l, mid);
		Build(Right(id), mid + 1, r);
		pair <int, int> r1 = st[Left(id)], r2 = st[Right(id)];
		if (a[r1.first] > a[r2.first]) st[id].first = r1.first; else st[id].first = r2.first;
		if (a[r1.second] < a[r2.second]) st[id].second = r1.second; else st[id].second = r2.second;
	}
}

pair <int, int> Query(int id, int l, int r, int u, int v) {
	if (l > v || r < u) return {-1, -1};
	if (l >= u && r <= v) return st[id];
	int mid = (l + r) >> 1;
	pair <int, int> r1 = Query(Left(id), l, mid, u, v), r2 = Query(Right(id), mid + 1, r, u, v);
	if (r1.first == -1) return r2;
	if (r2.first == -1) return r1;
	pair <int, int> ret;
	if (a[r1.first] > a[r2.first]) ret.first = r1.first; else ret.first = r2.first;
	if (a[r1.second] < a[r2.second]) ret.second = r1.second; else ret.second = r2.second;
	return ret;
}

int main(int argc, char const *argv[])
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	//freopen("487B.inp", "r", stdin);
	//freopen("487B.out", "w", stdout);
	int n, s, l;
	cin >> n >> s >> l;
	st.assign(4 * n, make_pair(0, 0));
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}
	Build(1, 1, n);
	int pt1 = 1, pt2 = 0;
	while (pt1 <= n) {
		pair <int, int> tmp;
		while (pt2 < pt1 - l) {
			tmp = Query(1,1,n,pt2 + 1,pt1);
			if (a[tmp.first] - a[tmp.second] > s) pt2++;
			else break;
		}
		tmp = Query(1,1,n,pt2 + 1,pt1);
		if (a[tmp.first] - a[tmp.second] > s) {
			dp[pt1] = -1;
			//cout << pt2 << ' ' << pt1 << " value is " << dp[pt1] << endl;
			pt1++;
			continue;
		}
		if (pt1 - pt2 >= l && dp[pt2] != -1) dp[pt1] = dp[pt2] + 1; else dp[pt1] = -1;
		//cout << pt2 << ' ' << pt1 << " value is " << dp[pt1] << endl;
		pt1++;
	}
	cout << dp[n];
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int N = 1e5 + 5;
vector < pair <int, int> > st;
int a[N], dp[N];

int Left(int x) {
	return (x << 1);
}
int Right(int x) {
	return (x << 1) + 1;
}
void Build(int id, int l, int r) {
	if (l == r) {
		st[id].first = l;
		st[id].second = r;
	} else {
		int mid = (l + r) >> 1;
		Build(Left(id), l, mid);
		Build(Right(id), mid + 1, r);
		pair <int, int> r1 = st[Left(id)], r2 = st[Right(id)];
		if (a[r1.first] > a[r2.first]) st[id].first = r1.first; else st[id].first = r2.first;
		if (a[r1.second] < a[r2.second]) st[id].second = r1.second; else st[id].second = r2.second;
	}
}

pair <int, int> Query(int id, int l, int r, int u, int v) {
	if (l > v || r < u) return {-1, -1};
	if (l >= u && r <= v) return st[id];
	int mid = (l + r) >> 1;
	pair <int, int> r1 = Query(Left(id), l, mid, u, v), r2 = Query(Right(id), mid + 1, r, u, v);
	if (r1.first == -1) return r2;
	if (r2.first == -1) return r1;
	pair <int, int> ret;
	if (a[r1.first] > a[r2.first]) ret.first = r1.first; else ret.first = r2.first;
	if (a[r1.second] < a[r2.second]) ret.second = r1.second; else ret.second = r2.second;
	return ret;
}

int main(int argc, char const *argv[])
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	//freopen("487B.inp", "r", stdin);
	//freopen("487B.out", "w", stdout);
	int n, s, l;
	cin >> n >> s >> l;
	st.assign(4 * n, make_pair(0, 0));
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}
	Build(1, 1, n);
	int pt1 = 1, pt2 = 0;
	while (pt1 <= n) {
		pair <int, int> tmp;
		while (pt2 < pt1 - l) {
			tmp = Query(1,1,n,pt2 + 1,pt1);
			if (a[tmp.first] - a[tmp.second] > s) pt2++;
			else {
				if (dp[pt2] != -1) break;
				else pt2++;
			}
		}
		tmp = Query(1,1,n,pt2 + 1,pt1);
		if (a[tmp.first] - a[tmp.second] > s) {
			dp[pt1] = -1;
			//cout << pt2 << ' ' << pt1 << " value is " << dp[pt1] << endl;
			pt1++;
			continue;
		}
		if (pt1 - pt2 >= l && dp[pt2] != -1) dp[pt1] = dp[pt2] + 1; else dp[pt1] = -1;
		//cout << pt2 << ' ' << pt1 << " value is " << dp[pt1] << endl;
		pt1++;
	}
	cout << dp[n];
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int N = 1e5;
vector < pair <int, int> > st;
int a[N], dp[N];

int Left(int x) {
	return (x << 1);
}
int Right(int x) {
	return (x << 1) + 1;
}
void Build(int id, int l, int r) {
	if (l == r) {
		st[id].first = l;
		st[id].second = r;
	} else {
		int mid = (l + r) >> 1;
		Build(Left(id), l, mid);
		Build(Right(id), mid + 1, r);
		pair <int, int> r1 = st[Left(id)], r2 = st[Right(id)];
		if (a[r1.first] > a[r2.first]) st[id].first = r1.first; else st[id].first = r2.first;
		if (a[r1.second] < a[r2.second]) st[id].second = r1.second; else st[id].second = r2.second;
	}
}

pair <int, int> Query(int id, int l, int r, int u, int v) {
	if (l > v || r < u) return {-1, -1};
	if (l >= u && r <= v) return st[id];
	int mid = (l + r) >> 1;
	pair <int, int> r1 = Query(Left(id), l, mid, u, v), r2 = Query(Right(id), mid + 1, r, u, v);
	if (r1.first == -1) return r2;
	if (r2.first == -1) return r1;
	pair <int, int> ret;
	if (a[r1.first] > a[r2.first]) ret.first = r1.first; else ret.first = r2.first;
	if (a[r1.second] < a[r2.second]) ret.second = r1.second; else ret.second = r2.second;
	return ret;
}

int main(int argc, char const *argv[])
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	//freopen("487B.inp", "r", stdin);
	//freopen("487B.out", "w", stdout);
	int n, s, l;
	cin >> n >> s >> l;
	st.assign(4 * n, make_pair(0, 0));
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}
	Build(1, 1, n);
	int pt1 = 1, pt2 = 0;
	while (pt1 <= n) {
		pair <int, int> tmp;
		while (pt2 <= pt1 - l) {
			tmp = Query(1,1,n,pt2 + 1,pt1);
			if (a[tmp.first] - a[tmp.second] > s) pt2++;
			else break;
		}
		if (a[tmp.first] - a[tmp.second] > s) {
			dp[pt1] = -1;
			pt1++;
			continue;
		}
		if (pt1 - pt2 >= l) dp[pt1] = dp[pt2] + 1; else dp[pt1] = -1;
		//cout << pt2 << ' ' << pt1 << " value is " << dp[pt1] << endl;
		pt1++;
	}
	cout << dp[n];
	return 0;
}


#include <bits/stdc++.h>
using namespace std;const int N = 1e5 + 5;vector < pair <int, int> > st;int a[N], dp[N];int Left(int x) {	return (x << 1);}int Right(int x) {	return (x << 1) + 1;}void Build(int id, int l, int r) {	if (l == r) {		st[id].first = l;		st[id].second = r;	} else {		int mid = (l + r) >> 1;		Build(Left(id), l, mid);		Build(Right(id), mid + 1, r);		pair <int, int> r1 = st[Left(id)], r2 = st[Right(id)];		if (a[r1.first] > a[r2.first]) st[id].first = r1.first; else st[id].first = r2.first;		if (a[r1.second] < a[r2.second]) st[id].second = r1.second; else st[id].second = r2.second;	}}pair <int, int> Query(int id, int l, int r, int u, int v) {	if (l > v || r < u) return {-1, -1};	if (l >= u && r <= v) return st[id];	int mid = (l + r) >> 1;	pair <int, int> r1 = Query(Left(id), l, mid, u, v), r2 = Query(Right(id), mid + 1, r, u, v);	if (r1.first == -1) return r2;	if (r2.first == -1) return r1;	pair <int, int> ret;	if (a[r1.first] > a[r2.first]) ret.first = r1.first; else ret.first = r2.first;	if (a[r1.second] < a[r2.second]) ret.second = r1.second; else ret.second = r2.second;	return ret;}int main(int argc, char const *argv[]){	ios_base::sync_with_stdio(0); cin.tie(0);	int n, s, l;	cin >> n >> s >> l;	st.assign(4 * n, make_pair(0, 0));	for (int i = 1; i <= n; ++i) {		cin >> a[i];	}	Build(1, 1, n);	int pt1 = 1, pt2 = 0;	while (pt1 <= n) {		pair <int, int> tmp;		while (pt2 < pt1 - l) {			tmp = Query(1,1,n,pt2 + 1,pt1);			if (a[tmp.first] - a[tmp.second] > s) pt2++;			else { 				if (dp[pt2] != -1) break;				else pt2++;			}		}		tmp = Query(1,1,n,pt2 + 1,pt1);		if (a[tmp.first] - a[tmp.second] > s) {			dp[pt1] = -1;			pt1++;			continue;		}		if (pt1 - pt2 >= l && dp[pt2] != -1) dp[pt1] = dp[pt2] + 1; else dp[pt1] = -1;		pt1++;	}	cout << dp[n];	return 0;}


/*     !ya khoda!     */
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

#define ll long long
#define ld long double

#define pp  push
#define po  pop()
#define pb  push_back
#define pf  push_front
#define pob pop_back()
#define pof pop_front()

#define F first
#define S second

#define mkp make_pair
#define pll pair<ll,ll>

#define coutghat(x)      cout<<tolower(x);
#define coutashar(x,d)   cout<<fixed<<setprecision(x)<<(ld)d
#define IOS ios_base::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
//#define poow(a,b,M)   b?(poow((a*a)%M,b/2)%M * (b&1?a))%M:1 ;
/*==========================================================================*/
using namespace std;
using namespace __gnu_pbds;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T> using ordered_multiset =  tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
//#pragma optimize O3
// 107,109, 211,223, 307, 401,409, 503,509, 601,607, 701,709, 809, 907, 1009
/*==========================================================================*/
const int N=1e5+100 , M=1e4 , LG=30 , base=2;
const int MOD=1e9+7 , mod=1e9+9;
const ll  INF=1e9   , inf=1e18 ;
ll n,sum,len,a[N] , last,dp[N];
deque<pll>mn,mx;
/*==========================================================================*/
int main()
{
    IOS;
	fill(dp,dp+N,INF)  ,  dp[0]=1;
	cin>>n>>sum>>len;

	for(int i=1;i<=n;i++)
    {
		cin>>a[i];

		while(mn.size() && mn.back().F<=a[i])     mn.pob;
		while(mx.size() && mx.back().F>=a[i])     mx.pob;
        mn.pb( {a[i],i} );
		mx.pb( {a[i],i} );

		while(i-last>=len)
        {
			if(dp[last]!=INF  &&  mn.front().F-mx.front().F<=sum)
			{
				dp[i]=dp[last]+1;
				break;
			}
			last++;
			if(mn.size() && mn.front().S<=last)   mn.pof;
			if(mx.size() && mx.front().S<=last)   mx.pof;
		}
	}
	if(dp[n]==INF)   cout<<-1;
	else             cout<<dp[n]-1;
    return 0;
}