#include<bits/stdc++.h>
using namespace std;
int n,l,u, A[10001],F[10001],P[10001];
int tuyetdoi(int k){
if (k < 0) return (k * -1);
else return k;
}
bool dieukien1(int l1, int l2){
if (tuyetdoi(l2 - l1) >= l) return true;
else return false;
}
bool dieukien2(int l1, int l2){
if (tuyetdoi(l1 - l1) <=u) return true;
else return false;
}
void daylon(){
for (int i = 1;i<n;i++){
for (int j = 2;j<=n;j++){
if (A[j] > A[i] && dieukien1(i,j) && dieukien2(A[i],A[j])){
F[i] = max(1,P[i] + 1);
}
if (A[j] < A[i] && dieukien1(i,j) && dieukien2(A[i],A[j])){
P[i] = max(1,F[i] + 1);
}
}
}
}
int main(){
cin >> n >> l >> u;
for (int i = 1;i<=n;i++){
cin >> A[i];
}
F[1] = 1;
P[1] = 1;
daylon();
int max2 = 0;
for (int i = 1;i<=n;i++){
if (max2 < F[i] || max2 < P[i]) max2 = max(F[i],P[i]);
}
cout << max2;
}