Alexandra has a paper strip with n numbers on it. Let's call them ai from left to right.

Now Alexandra wants to split it into some pieces (possibly 1). For each piece of strip, it must satisfy:

  * Each piece should contain at least l numbers.
  * The difference between the maximal and the minimal number on the piece should be at most s.



Please help Alexandra to find the minimal number of pieces meeting the condition above.

Input

The first line contains three space-separated integers n, s, l (1 ≤ n ≤ 105, 0 ≤ s ≤ 109, 1 ≤ l ≤ 105).

The second line contains n integers ai separated by spaces ( - 109 ≤ ai ≤ 109).

Output

Output the minimal number of strip pieces.

If there are no ways to split the strip, output -1.

Examples

Input

7 2 2
1 3 1 2 4 1 2


Output

3


Input

7 2 2
1 100 1 100 1 100 1


Output

-1

Note

For the first sample, we can split the strip into 3 pieces: [1, 3, 1], [2, 4], [1, 2].

For the second sample, we can't let 1 and 100 be on the same piece, so no solution exists.

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;

public class Strip {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s = sc.nextInt();
        int l = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        int res = calc2(n, s, l, a);

        System.out.println(res);
    }

    private static int calc1(int n, int s, int l, int[] a) {
        // number of split intervals
        // last interval ends in i-1
        // [a, b)
        int[] d = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            int max = -1;
            int min = Integer.MAX_VALUE;

            d[i] = -1;
            for (int j = i - 1; j >= 0; j--) {
                max = Math.max(a[j], max);
                min = Math.min(a[j], min);
                if (max - min > s) {
                    break;
                }
                if (i - j < l) {
                    continue;
                }

                if (d[j] >= 0) {
                    if (d[i] > 0) {
                        d[i] = Math.min(d[i], d[j] + 1);
                    } else {
                        d[i] = d[j] + 1;
                    }
                }
            }
        }
        return d[n];
    }

    private static int calc2(int n, int s, int l, int[] a) {
        Deque<Pos> minQueue = new ArrayDeque<>();
        Deque<Pos> maxQueue = new ArrayDeque<>();
        //queue of positions with minimal splits ending in this point
        Deque<Pos> minPrevSplit = new ArrayDeque<>();

        minPrevSplit.add(new Pos(-1, 0));

        int startPrev = -1;
        int endPrev = 1;
        int current = l;
        for (int i = 0; i < Math.min(l, a.length); i++) {
            int currA = a[i];
            while (!minQueue.isEmpty() && minQueue.peekLast().getValue() > currA) {
                minQueue.removeLast();
            }
            minQueue.addLast(new Pos(i, currA));

            while (!maxQueue.isEmpty() && maxQueue.peekLast().getValue() < currA) {
                maxQueue.removeLast();
            }
            maxQueue.addLast(new Pos(i, currA));
        }
        if (maxQueue.peekFirst().getValue() - minQueue.peekFirst().getValue() > s) {
            return -1;
        }
        minPrevSplit.add(new Pos(l - 1, 1));

        while (current < n) {
            //check interval [startPrev .. endPrev)
            int currA = a[current];
            if (currA > maxQueue.peekLast().getValue()) {
                while (!maxQueue.isEmpty() && maxQueue.peekLast().getValue() <= currA) {
                    maxQueue.removeLast();
                }
            }
            maxQueue.addLast(new Pos(current, currA));

            if (currA < minQueue.peekLast().getValue()) {
                while (!minQueue.isEmpty() && minQueue.peekLast().getValue() >= currA) {
                    minQueue.removeLast();
                }
            }
            minQueue.addLast(new Pos(current, currA));

            int diff;
            while (true) {
                Pos posMin = minQueue.peekFirst();
                Pos posMax = maxQueue.peekFirst();
                diff = posMax.getValue() - posMin.getValue();
                if (diff > s) {
                    if (posMin.getPos() < posMax.getPos()) {
                        startPrev = minQueue.removeFirst().getPos() ;
                    } else if (posMin.getPos() > posMax.getPos()) {
                        startPrev = maxQueue.removeFirst().getPos() ;
                    }
                } else {
                    break;
                }
            }

            endPrev++;


            while (!minPrevSplit.isEmpty() && minPrevSplit.peekFirst().getPos() < startPrev) {
                minPrevSplit.removeFirst();
            }

            Pos posSplit = minPrevSplit.peekFirst();
            if (posSplit != null && current - posSplit.getPos() >= l) {
                Pos posSplitNew = new Pos(current, posSplit.getValue() + 1);

                while (!minPrevSplit.isEmpty() && minPrevSplit.peekLast().getValue() > posSplitNew.getValue()) {
                    minPrevSplit.removeLast();
                }
                minPrevSplit.addLast(posSplitNew);
            }
            current++;
        }
        Pos pos = minPrevSplit.peekLast();
        if (pos != null && pos.getPos() == n - 1) {
            return pos.getValue();
        } else {
            return -1;
        }
    }

    private static class Pos {
        int pos;
        int value;

        private Pos(int pos, int value) {
            this.pos = pos;
            this.value = value;
        }

        private int getPos() {
            return pos;
        }

        private int getValue() {
            return value;
        }
    }
}
