import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Deque;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.TreeSet;

public class Library {
    static int[] di = { 0, -1, 0, 1 };
    static int[] dj = { -1, 0, 1, 0 };

    static int[] di_knight = { -1, -1, -2, -2, 1, 1, 2, 2 };
    static int[] dj_knight = { 2, -2, -1, 1, 2, -2, -1, 1 };

    static BufferedReader br = new BufferedReader(new InputStreamReader(
            System.in));

    public static void main(String[] args) throws Exception {
        int in[] = readIntArray();
        int arr[] = readIntArray();

        if (in[1] == in[0]) {
            System.out.println(1);
            return;
        }

        int min = Integer.MAX_VALUE;
        int minIndex = 0;
        int cnt = 0;

        for (int i = 0; i < in[1]; i++) {
            cnt += arr[i];
        }

        min = cnt;

        for (int i = 1; i < arr.length - in[1] + 1; i++) {
            cnt -= arr[i - 1];
            cnt += arr[i + in[1] - 1];

            if (min > cnt) {
                min = cnt;
                minIndex = i;
            }
        }

        System.out.println(minIndex + 1);
    }

    // Check if String A is smaller lexicographically than String B
    public static boolean compareStringLexicographically(String A, String B) {
        if (A == null || B == null)
            return true;

        if (B.indexOf(A) == 0)
            return true;

        for (int i = 0; i < Math.min(A.length(), B.length()); i++) {
            if (A.charAt(i) != B.charAt(i))
                return A.charAt(i) < B.charAt(i);
        }

        return A.length() < B.length();
    }

    public static int roundUp(int a, int b) {
        return (int) Math.ceil(a / (b * 1.0));
    }

    // Read Integer
    public static int readInt() throws Exception {
        return Integer.parseInt(br.readLine());
    }

    // Read Integer Array
    public static int[] readIntArray() throws Exception {
        String[] s = br.readLine().split(" ");
        int arr[] = new int[s.length];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = Integer.parseInt(s[i]);
        }

        return arr;
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Deque;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.TreeSet;

public class Library {
    static int[] di = { 0, -1, 0, 1 };
    static int[] dj = { -1, 0, 1, 0 };

    static int[] di_knight = { -1, -1, -2, -2, 1, 1, 2, 2 };
    static int[] dj_knight = { 2, -2, -1, 1, 2, -2, -1, 1 };

    static BufferedReader br = new BufferedReader(new InputStreamReader(
            System.in));

    public static void main(String[] args) throws Exception {
        int in[] = readIntArray();
        int arr[] = readIntArray();

        if (in[1] == in[0]) {
            System.out.println(0);
            return;
        }

        int min = Integer.MAX_VALUE;
        int minIndex = 0;
        int cnt = 0;

        for (int i = 0; i < in[1]; i++) {
            cnt += arr[i];
        }

        for (int i = in[1]; i < arr.length; i++) {
            cnt -= arr[i - in[1]];
            cnt += arr[i];

            if (min > cnt) {
                min = cnt;
                minIndex = i;
            }
        }

        System.out.println(minIndex - in[1] + 2);
    }

    // Check if String A is smaller lexicographically than String B
    public static boolean compareStringLexicographically(String A, String B) {
        if (A == null || B == null)
            return true;

        if (B.indexOf(A) == 0)
            return true;

        for (int i = 0; i < Math.min(A.length(), B.length()); i++) {
            if (A.charAt(i) != B.charAt(i))
                return A.charAt(i) < B.charAt(i);
        }

        return A.length() < B.length();
    }

    public static int roundUp(int a, int b) {
        return (int) Math.ceil(a / (b * 1.0));
    }

    // Read Integer
    public static int readInt() throws Exception {
        return Integer.parseInt(br.readLine());
    }

    // Read Integer Array
    public static int[] readIntArray() throws Exception {
        String[] s = br.readLine().split(" ");
        int arr[] = new int[s.length];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = Integer.parseInt(s[i]);
        }

        return arr;
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Deque;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.TreeSet;

public class Library {
    static int[] di = { 0, -1, 0, 1 };
    static int[] dj = { -1, 0, 1, 0 };

    static int[] di_knight = { -1, -1, -2, -2, 1, 1, 2, 2 };
    static int[] dj_knight = { 2, -2, -1, 1, 2, -2, -1, 1 };

    static BufferedReader br = new BufferedReader(new InputStreamReader(
            System.in));

    public static void main(String[] args) throws Exception {
        int in[] = readIntArray();
        int arr[] = readIntArray();

        if (in[1] == in[0]) {
            System.out.println(1);
            return;
        }

        int min = Integer.MAX_VALUE;
        int minIndex = 0;
        int cnt = 0;

        for (int i = 0; i < in[1]; i++) {
            cnt += arr[i];
        }

        for (int i = in[1]; i < arr.length; i++) {
            cnt -= arr[i - in[1]];
            cnt += arr[i];

            if (min > cnt) {
                min = cnt;
                minIndex = i;
            }
        }

        System.out.println(minIndex - in[1] + 2);
    }

    // Check if String A is smaller lexicographically than String B
    public static boolean compareStringLexicographically(String A, String B) {
        if (A == null || B == null)
            return true;

        if (B.indexOf(A) == 0)
            return true;

        for (int i = 0; i < Math.min(A.length(), B.length()); i++) {
            if (A.charAt(i) != B.charAt(i))
                return A.charAt(i) < B.charAt(i);
        }

        return A.length() < B.length();
    }

    public static int roundUp(int a, int b) {
        return (int) Math.ceil(a / (b * 1.0));
    }

    // Read Integer
    public static int readInt() throws Exception {
        return Integer.parseInt(br.readLine());
    }

    // Read Integer Array
    public static int[] readIntArray() throws Exception {
        String[] s = br.readLine().split(" ");
        int arr[] = new int[s.length];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = Integer.parseInt(s[i]);
        }

        return arr;
    }
}


import java.util.*;

public class B {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt(),
        k = sc.nextInt();
    ArrayList<Integer> arr = new ArrayList<Integer>();

    for (int i = 0; i < n; i++) {
      int x = sc.nextInt();
      arr.add(x);
    }

    int ans = 1;
    int currentSum = 0;
    for(int i = 0; i<k; i++){
      currentSum += arr.get(i);
    }

    int sum = currentSum;
    for(int i = 1; i<n-k+1; i++){
      currentSum -= arr.get(i-1);
      currentSum += arr.get(i+k-1);
      if (currentSum < sum){
        sum = currentSum;
        ans = i+1;
      }
    }
    System.out.println(ans);

  }
}


import java.util.*;

public class B {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt(),
        k = sc.nextInt();
    ArrayList<Integer> arr = new ArrayList<Integer>();

    for (int i = 0; i < n; i++) {
      int x = sc.nextInt();
      arr.add(x);
    }

    int ans = 1;
    int sum = 100*k;
    int currentSum = 0;
    for(int i = 0; i<k; i++){
      currentSum += arr.get(i);
    }

    for(int i = 1; i<n-k; i++){
      currentSum -= arr.get(i-1);
      currentSum += arr.get(i+k-1);
      if (currentSum < sum){
        sum = currentSum;
        ans = i+1;
      }
    }
    System.out.println(ans);

  }
}


import java.util.*;

public class B {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt(),
        k = sc.nextInt();
    ArrayList<Integer> arr = new ArrayList<Integer>();

    for (int i = 0; i < n; i++) {
      int x = sc.nextInt();
      arr.add(x);
    }

    int ans = 1;
    int sum = 101*k;
    int currentSum = 0;
    for(int i = 0; i<k; i++){
      currentSum += arr.get(i);
    }

    for(int i = 1; i<n-k+1; i++){
      currentSum -= arr.get(i-1);
      currentSum += arr.get(i+k-1);
      if (currentSum < sum){
        sum = currentSum;
        ans = i+1;
      }
    }
    System.out.println(ans);

  }
}


import java.util.*;

public class B {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt(),
        k = sc.nextInt();
    ArrayList<Integer> arr = new ArrayList<Integer>();

    for (int i = 0; i < n; i++) {
      int x = sc.nextInt();
      arr.add(x);
    }

    int ans = 0;
    int sum = 100*k;
    for(int i = 0; i<n-k; i++){
      int currentSum = 0;
      for(int j=0; j<k; j++){
        currentSum += arr.get(i+j);
      }
      if (currentSum < sum){
        sum = currentSum;
        ans = i+1;
      }

    }
    System.out.println(ans);

  }
}


import java.util.*;

public class B {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt(),
        k = sc.nextInt();
    ArrayList<Integer> arr = new ArrayList<Integer>();

    for (int i = 0; i < n; i++) {
      int x = sc.nextInt();
      arr.add(x);
    }

    int ans = 1;
    int sum = 100*k;
    for(int i = 0; i<n-k; i++){
      int currentSum = 0;
      for(int j=0; j<k; j++){
        currentSum += arr.get(i+j);
      }
      if (currentSum < sum){
        sum = currentSum;
        ans = i+1;
      }

    }
    System.out.println(ans);

  }
}


import java.io.IOException;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.PrintStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int N=in.readInt();
        int K=in.readInt();
        int sum[]=new int[N];
        int H[]=new int[N];
        H[0]=sum[0]=in.readInt();
        for (int i=1;i<N;i++) sum[i]=sum[i-1]+(H[i]=in.readInt());
        int min=Integer.MAX_VALUE;
        int ans=0;
        System.out.println(Arrays.toString(sum));
        for (int i=0;i<N-K+1;i++){
            if(min>sum[i+K-1]-sum[i]+H[i]){
                min=sum[i+K-1]-sum[i]+H[i];
                ans=i+1;
            }
        }
        out.println(ans);
    }
}

class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
                this.stream = stream;
        }

        public int read() {
                if (numChars == -1)
                        throw new InputMismatchException();
                if (curChar >= numChars) {
                        curChar = 0;
                        try {
                                numChars = stream.read(buf);
                        } catch (IOException e) {
                                throw new InputMismatchException();
                        }
                        if (numChars <= 0)
                                return -1;
                }
                return buf[curChar++];
        }

        public int readInt() {
                int c = read();
                while (isSpaceChar(c))
                        c = read();
                int sgn = 1;
                if (c == '-') {
                        sgn = -1;
                        c = read();
                }
                int res = 0;
                do {
                        if (c < '0' || c > '9')
                                throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                } while (!isSpaceChar(c));
                return res * sgn;
        }

        public boolean isSpaceChar(int c) {
                if (filter != null)
                        return filter.isSpaceChar(c);
                return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
        }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int N=in.readInt();
        int K=in.readInt();
        int sum[]=new int[N];
        int H[]=new int[N];
        H[0]=sum[0]=in.readInt();
        for (int i=1;i<N;i++) sum[i]=sum[i-1]+(H[i]=in.readInt());
        int min=Integer.MAX_VALUE;
        int ans=0;
        for (int i=0;i<N-K+1;i++){
            if(min>sum[i+K-1]-sum[i]+H[i]){
                min=sum[i+K-1]-sum[i]+H[i];
                ans=i+1;
            }
        }
        out.println(ans);
    }
}

class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
                this.stream = stream;
        }

        public int read() {
                if (numChars == -1)
                        throw new InputMismatchException();
                if (curChar >= numChars) {
                        curChar = 0;
                        try {
                                numChars = stream.read(buf);
                        } catch (IOException e) {
                                throw new InputMismatchException();
                        }
                        if (numChars <= 0)
                                return -1;
                }
                return buf[curChar++];
        }

        public int readInt() {
                int c = read();
                while (isSpaceChar(c))
                        c = read();
                int sgn = 1;
                if (c == '-') {
                        sgn = -1;
                        c = read();
                }
                int res = 0;
                do {
                        if (c < '0' || c > '9')
                                throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = read();
                } while (!isSpaceChar(c));
                return res * sgn;
        }

        public boolean isSpaceChar(int c) {
                if (filter != null)
                        return filter.isSpaceChar(c);
                return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
        }
}


import java.util.Scanner;
import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {

    public void solve(int testNumber, Scanner in, PrintWriter out) {
        int n = in.nextInt();
        int k = in.nextInt();
        int[] fence = new int[n];

        for(int i = 0; i < n; i++)
        {
            int val = in.nextInt();
            if(i > 0)
                fence[i] = fence[i - 1] + val;
            else
                fence[i] = val;
        }

        int min = fence[k - 1];
        int pos = 1;

        for(int i = 1; i <= n - k; i++)
        {
            int val = fence[i + k - 1] - fence[i - 1];

            if(val < min)
            {
                pos = i + 1;
                min = val;
            }
        }
        out.println(pos);
    }
}


import java.util.Scanner;
import java.io.PrintStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {

    public void solve(int testNumber, Scanner in, PrintWriter out) {
        int n = in.nextInt();
        int k = in.nextInt();
        int[] fence = new int[n];

        for(int i = 0; i < n; i++)
        {
            int val = in.nextInt();
            if(i > 0)
                fence[i] = fence[i - 1] + val;
            else
                fence[i] = val;
        }
        for(int x : fence)
            System.out.print(x + " ");
        System.out.println();

        int min = fence[2];
        int pos = -1;

        for(int i = 1; i <= n - k; i++)
        {
            int val = fence[i + k - 1] - fence[i - 1];
            System.out.println("val " + val);

            if(val < min)
            {
                pos = i + 1;
                min = val;
            }
        }

        out.println(pos);
    }
}


import java.util.Scanner;
import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {

    public void solve(int testNumber, Scanner in, PrintWriter out) {
        int n = in.nextInt();
        int k = in.nextInt();
        int[] fence = new int[n];

        for(int i = 0; i < n; i++)
        {
            int val = in.nextInt();
            if(i > 0)
                fence[i] = fence[i - 1] + val;
            else
                fence[i] = val;
        }

        int min = fence[2];
        int pos = -1;

        for(int i = 1; i <= n - k; i++)
        {
            int val = fence[i + k - 1] - fence[i - 1];

            if(val < min)
            {
                pos = i + 1;
                min = val;
            }
        }
        out.println(pos);
    }
}


import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.Comparator;
import java.io.OutputStream;
import java.util.RandomAccess;
import java.io.PrintWriter;
import java.util.Random;
import java.util.AbstractList;
import java.io.Writer;
import java.util.Map;
import java.util.List;
import java.io.IOException;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.AbstractSet;
import java.util.Iterator;
import java.util.Set;
import java.util.AbstractMap;
import java.util.NoSuchElementException;
import java.math.BigInteger;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nguyen Trung Hieu - vuondenthanhcong11@yahoo.com
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskB {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int count = in.readInt();
        int k = in.readInt();
        int[] A = IOUtils.readIntArray(in, count);
        long[] sum = ArrayUtils.partialSums(A);
        int answer = 1;
        for (int i = 1; i <= count - k + 1; i++) {
            if (sum[i + k - 1] - sum[i - 1] < sum[answer + k - 1] - sum[answer - 1])
                answer = i;
        }

        out.printLine(answer);
    }
}

class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }

    }

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object...objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}

class IOUtils {

    public static int[] readIntArray(InputReader in, int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = in.readInt();
        return array;
    }

    }

class ArrayUtils {

    /*Them boi Nguyen Trung Hieu*/

    public static long[] partialSums(int[] array) {
        long[] result = new long[array.length + 1];
        for (int i = 0; i < array.length; i++)
            result[i + 1] = result[i] + array[i];
        return result;
    }

    //update 24/8/2013

    }

abstract class IntCollection {
    public abstract IntIterator iterator();
    public abstract int size();

    }

interface IntIterator {
    public int value() throws NoSuchElementException;
    /*
     * @throws NoSuchElementException only if iterator already invalid
     */
    public void advance() throws NoSuchElementException;
    public boolean isValid();
}

interface IntComparator {
    public static final IntComparator DEFAULT = new IntComparator() {
        public int compare(int first, int second) {
            if (first < second)
                return -1;
            if (first > second)
                return 1;
            return 0;
        }
    };

    public int compare(int first, int second);
}

abstract class IntList extends IntCollection implements Comparable<IntList> {
    private static final int INSERTION_THRESHOLD = 8;

    public abstract int get(int index);
    public abstract void set(int index, int value);

    public IntIterator iterator() {
        return new IntIterator() {
            private int size = size();
            private int index = 0;

            public int value() throws NoSuchElementException {
                if (!isValid())
                    throw new NoSuchElementException();
                return get(index);
            }

            public void advance() throws NoSuchElementException {
                if (!isValid())
                    throw new NoSuchElementException();
                index++;
            }

            public boolean isValid() {
                return index < size;
            }
        };
    }

    private void swap(int first, int second) {
        if (first == second)
            return;
        int temp = get(first);
        set(first, get(second));
        set(second, temp);
    }

    public IntSortedList inPlaceSort(IntComparator comparator) {
        quickSort(0, size() - 1, size(), comparator);
        return new IntSortedArray(this, comparator);
    }

    private void quickSort(int from, int to, int remaining, IntComparator comparator) {
        if (to - from < INSERTION_THRESHOLD) {
            insertionSort(from, to, comparator);
            return;
        }
        if (remaining == 0) {
            heapSort(from, to, comparator);
            return;
        }
        remaining >>= 1;
        int pivotIndex = (from + to) >> 1;
        int pivot = get(pivotIndex);
        swap(pivotIndex, to);
        int storeIndex = from;
        int equalIndex = to;
        for (int i = from; i < equalIndex; i++) {
            int value = comparator.compare(get(i), pivot);
            if (value < 0)
                swap(storeIndex++, i);
            else if (value == 0)
                swap(--equalIndex, i--);
        }
        quickSort(from, storeIndex - 1, remaining, comparator);
        for (int i = equalIndex; i <= to; i++)
            swap(storeIndex++, i);
        quickSort(storeIndex, to, remaining, comparator);
    }

    private void heapSort(int from, int to, IntComparator comparator) {
        for (int i = (to + from - 1) >> 1; i >= from; i--)
            siftDown(i, to, comparator, from);
        for (int i = to; i > from; i--) {
            swap(from, i);
            siftDown(from, i - 1, comparator, from);
        }
    }

    private void siftDown(int start, int end, IntComparator comparator, int delta) {
        int value = get(start);
        while (true) {
            int child = ((start - delta) << 1) + 1 + delta;
            if (child > end)
                return;
            int childValue = get(child);
            if (child + 1 <= end) {
                int otherValue = get(child + 1);
                if (comparator.compare(otherValue, childValue) > 0) {
                    child++;
                    childValue = otherValue;
                }
            }
            if (comparator.compare(value, childValue) >= 0)
                return;
            swap(start, child);
            start = child;
        }
    }

    private void insertionSort(int from, int to, IntComparator comparator) {
        for (int i = from + 1; i <= to; i++) {
            int value = get(i);
            for (int j = i - 1; j >= from; j--) {
                if (comparator.compare(get(j), value) <= 0)
                    break;
                swap(j, j + 1);
            }
        }
    }

    public int hashCode() {
        int hashCode = 1;
        for (IntIterator i = iterator(); i.isValid(); i.advance())
            hashCode = 31 * hashCode + i.value();
        return hashCode;
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof IntList))
            return false;
        IntList list = (IntList)obj;
        if (list.size() != size())
            return false;
        IntIterator i = iterator();
        IntIterator j = list.iterator();
        while (i.isValid()) {
            if (i.value() != j.value())
                return false;
            i.advance();
            j.advance();
        }
        return true;
    }

    public int compareTo(IntList o) {
        IntIterator i = iterator();
        IntIterator j = o.iterator();
        while (true) {
            if (i.isValid()) {
                if (j.isValid()) {
                    if (i.value() != j.value()) {
                        if (i.value() < j.value())
                            return -1;
                        else
                            return 1;
                    }
                } else
                    return 1;
            } else {
                if (j.isValid())
                    return -1;
                else
                    return 0;
            }
            i.advance();
            j.advance();
        }
    }

    public IntSortedList sort(IntComparator comparator) {
        return new IntArray(this).inPlaceSort(comparator);
    }

    }

abstract class IntSortedList extends IntList {
    protected final IntComparator comparator;

    protected IntSortedList(IntComparator comparator) {
        this.comparator = comparator;
    }

    public void set(int index, int value) {
        throw new UnsupportedOperationException();
    }

    public IntSortedList inPlaceSort(IntComparator comparator) {
        if (comparator == this.comparator)
            return this;
        throw new UnsupportedOperationException();
    }

    public IntSortedList sort(IntComparator comparator) {
        if (comparator == this.comparator)
            return this;
        return super.sort(comparator);
    }

    protected void ensureSorted() {
        int size = size();
        if (size == 0)
            return;
        int last = get(0);
        for (int i = 1; i < size; i++) {
            int current = get(i);
            if (comparator.compare(last, current) > 0)
                throw new IllegalArgumentException();
            last = current;
        }
    }

    }

class IntArray extends IntList {
    private final int[] array;

    public IntArray(int[] array) {
        this.array = array;
    }

    public IntArray(IntCollection collection) {
        array = new int[collection.size()];
        int i = 0;
        for (IntIterator iterator = collection.iterator(); iterator.isValid(); iterator.advance())
            array[i++] = iterator.value();
    }

    public int get(int index) {
        return array[index];
    }

    public void set(int index, int value) {
        array[index] = value;
    }

    public int size() {
        return array.length;
    }

    }

class IntSortedArray extends IntSortedList {
    private final int[] array;

    public IntSortedArray(int[] array) {
        this(array, IntComparator.DEFAULT);
    }

    public IntSortedArray(IntCollection collection) {
        this(collection, IntComparator.DEFAULT);
    }

    public IntSortedArray(int[] array, IntComparator comparator) {
        super(comparator);
        this.array = array;
        ensureSorted();
    }

    public IntSortedArray(IntCollection collection, IntComparator comparator) {
        super(comparator);
        array = new int[collection.size()];
        int i = 0;
        for (IntIterator iterator = collection.iterator(); iterator.isValid(); iterator.advance())
            array[i++] = iterator.value();
        ensureSorted();
    }

    public int get(int index) {
        return array[index];
    }

    public int size() {
        return array.length;
    }
}


import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.Comparator;
import java.io.OutputStream;
import java.util.RandomAccess;
import java.io.PrintWriter;
import java.util.Random;
import java.util.AbstractList;
import java.io.Writer;
import java.util.Map;
import java.util.List;
import java.io.IOException;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.AbstractSet;
import java.util.Iterator;
import java.util.Set;
import java.util.AbstractMap;
import java.util.NoSuchElementException;
import java.math.BigInteger;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nguyen Trung Hieu - vuondenthanhcong11@yahoo.com
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskB {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int count = in.readInt();
        int k = in.readInt();
        int[] A = IOUtils.readIntArray(in, count);
        long[] sum = ArrayUtils.partialSums(A);
        int answer = 1;
        for (int i = 1; i <= count - k; i++) {
            if (sum[i + k - 1] - sum[i - 1] < sum[answer + k - 1] - sum[answer - 1])
                answer = i;
        }

        out.printLine(answer);
    }
}

class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }

    }

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object...objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}

class IOUtils {

    public static int[] readIntArray(InputReader in, int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = in.readInt();
        return array;
    }

    }

class ArrayUtils {

    /*Them boi Nguyen Trung Hieu*/

    public static long[] partialSums(int[] array) {
        long[] result = new long[array.length + 1];
        for (int i = 0; i < array.length; i++)
            result[i + 1] = result[i] + array[i];
        return result;
    }

    //update 24/8/2013

    }

abstract class IntCollection {
    public abstract IntIterator iterator();
    public abstract int size();

    }

interface IntIterator {
    public int value() throws NoSuchElementException;
    /*
     * @throws NoSuchElementException only if iterator already invalid
     */
    public void advance() throws NoSuchElementException;
    public boolean isValid();
}

interface IntComparator {
    public static final IntComparator DEFAULT = new IntComparator() {
        public int compare(int first, int second) {
            if (first < second)
                return -1;
            if (first > second)
                return 1;
            return 0;
        }
    };

    public int compare(int first, int second);
}

abstract class IntList extends IntCollection implements Comparable<IntList> {
    private static final int INSERTION_THRESHOLD = 8;

    public abstract int get(int index);
    public abstract void set(int index, int value);

    public IntIterator iterator() {
        return new IntIterator() {
            private int size = size();
            private int index = 0;

            public int value() throws NoSuchElementException {
                if (!isValid())
                    throw new NoSuchElementException();
                return get(index);
            }

            public void advance() throws NoSuchElementException {
                if (!isValid())
                    throw new NoSuchElementException();
                index++;
            }

            public boolean isValid() {
                return index < size;
            }
        };
    }

    private void swap(int first, int second) {
        if (first == second)
            return;
        int temp = get(first);
        set(first, get(second));
        set(second, temp);
    }

    public IntSortedList inPlaceSort(IntComparator comparator) {
        quickSort(0, size() - 1, size(), comparator);
        return new IntSortedArray(this, comparator);
    }

    private void quickSort(int from, int to, int remaining, IntComparator comparator) {
        if (to - from < INSERTION_THRESHOLD) {
            insertionSort(from, to, comparator);
            return;
        }
        if (remaining == 0) {
            heapSort(from, to, comparator);
            return;
        }
        remaining >>= 1;
        int pivotIndex = (from + to) >> 1;
        int pivot = get(pivotIndex);
        swap(pivotIndex, to);
        int storeIndex = from;
        int equalIndex = to;
        for (int i = from; i < equalIndex; i++) {
            int value = comparator.compare(get(i), pivot);
            if (value < 0)
                swap(storeIndex++, i);
            else if (value == 0)
                swap(--equalIndex, i--);
        }
        quickSort(from, storeIndex - 1, remaining, comparator);
        for (int i = equalIndex; i <= to; i++)
            swap(storeIndex++, i);
        quickSort(storeIndex, to, remaining, comparator);
    }

    private void heapSort(int from, int to, IntComparator comparator) {
        for (int i = (to + from - 1) >> 1; i >= from; i--)
            siftDown(i, to, comparator, from);
        for (int i = to; i > from; i--) {
            swap(from, i);
            siftDown(from, i - 1, comparator, from);
        }
    }

    private void siftDown(int start, int end, IntComparator comparator, int delta) {
        int value = get(start);
        while (true) {
            int child = ((start - delta) << 1) + 1 + delta;
            if (child > end)
                return;
            int childValue = get(child);
            if (child + 1 <= end) {
                int otherValue = get(child + 1);
                if (comparator.compare(otherValue, childValue) > 0) {
                    child++;
                    childValue = otherValue;
                }
            }
            if (comparator.compare(value, childValue) >= 0)
                return;
            swap(start, child);
            start = child;
        }
    }

    private void insertionSort(int from, int to, IntComparator comparator) {
        for (int i = from + 1; i <= to; i++) {
            int value = get(i);
            for (int j = i - 1; j >= from; j--) {
                if (comparator.compare(get(j), value) <= 0)
                    break;
                swap(j, j + 1);
            }
        }
    }

    public int hashCode() {
        int hashCode = 1;
        for (IntIterator i = iterator(); i.isValid(); i.advance())
            hashCode = 31 * hashCode + i.value();
        return hashCode;
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof IntList))
            return false;
        IntList list = (IntList)obj;
        if (list.size() != size())
            return false;
        IntIterator i = iterator();
        IntIterator j = list.iterator();
        while (i.isValid()) {
            if (i.value() != j.value())
                return false;
            i.advance();
            j.advance();
        }
        return true;
    }

    public int compareTo(IntList o) {
        IntIterator i = iterator();
        IntIterator j = o.iterator();
        while (true) {
            if (i.isValid()) {
                if (j.isValid()) {
                    if (i.value() != j.value()) {
                        if (i.value() < j.value())
                            return -1;
                        else
                            return 1;
                    }
                } else
                    return 1;
            } else {
                if (j.isValid())
                    return -1;
                else
                    return 0;
            }
            i.advance();
            j.advance();
        }
    }

    public IntSortedList sort(IntComparator comparator) {
        return new IntArray(this).inPlaceSort(comparator);
    }

    }

abstract class IntSortedList extends IntList {
    protected final IntComparator comparator;

    protected IntSortedList(IntComparator comparator) {
        this.comparator = comparator;
    }

    public void set(int index, int value) {
        throw new UnsupportedOperationException();
    }

    public IntSortedList inPlaceSort(IntComparator comparator) {
        if (comparator == this.comparator)
            return this;
        throw new UnsupportedOperationException();
    }

    public IntSortedList sort(IntComparator comparator) {
        if (comparator == this.comparator)
            return this;
        return super.sort(comparator);
    }

    protected void ensureSorted() {
        int size = size();
        if (size == 0)
            return;
        int last = get(0);
        for (int i = 1; i < size; i++) {
            int current = get(i);
            if (comparator.compare(last, current) > 0)
                throw new IllegalArgumentException();
            last = current;
        }
    }

    }

class IntArray extends IntList {
    private final int[] array;

    public IntArray(int[] array) {
        this.array = array;
    }

    public IntArray(IntCollection collection) {
        array = new int[collection.size()];
        int i = 0;
        for (IntIterator iterator = collection.iterator(); iterator.isValid(); iterator.advance())
            array[i++] = iterator.value();
    }

    public int get(int index) {
        return array[index];
    }

    public void set(int index, int value) {
        array[index] = value;
    }

    public int size() {
        return array.length;
    }

    }

class IntSortedArray extends IntSortedList {
    private final int[] array;

    public IntSortedArray(int[] array) {
        this(array, IntComparator.DEFAULT);
    }

    public IntSortedArray(IntCollection collection) {
        this(collection, IntComparator.DEFAULT);
    }

    public IntSortedArray(int[] array, IntComparator comparator) {
        super(comparator);
        this.array = array;
        ensureSorted();
    }

    public IntSortedArray(IntCollection collection, IntComparator comparator) {
        super(comparator);
        array = new int[collection.size()];
        int i = 0;
        for (IntIterator iterator = collection.iterator(); iterator.isValid(); iterator.advance())
            array[i++] = iterator.value();
        ensureSorted();
    }

    public int get(int index) {
        return array[index];
    }

    public int size() {
        return array.length;
    }
}


import java.util.Scanner;

public class Fence {

	public int somme(int []table ,int k,int debut)
	{   int sum=0;
		for(int i=debut;i<k+debut;i++){

			sum=sum+table[i];
		}
		return sum;
	}
	public  int max_index(int[] table,int k)
	{
		int index=0;
		for(int i=0;i<table.length-1-k;i++)
		{
			if(somme(table,k,i)<somme(table,k,i+1)){
				index=i;
			}
		}
		return index;
	}

	public static void main(String[] args) {
		Fence f=new Fence();
		Scanner sc =new Scanner(System.in);
		int n =sc.nextInt();
		int k=sc.nextInt();
		int [] height=new int[150000];
      for(int i=0;i<n;i++)
      {
    	  height[i]=sc.nextInt();
      }
       int index=f.max_index(height, k);
       if(n==k){System.out.println(0);}
       if(n!=k)
      {System.out.println(index+1);}
	}

}


import java.util.Scanner;

public class Fence {

    public int somme(int []table ,int k,int debut)
    {   int sum=0;
        for(int i=debut;i<k+debut;i++){

            sum=sum+table[i];
        }
        return sum;
    }
    public  int max_index(int[] table,int k)
    {
        int index=0;
        for(int i=0;i<table.length-1-k;i++)
        {
            if(somme(table,k,i)<somme(table,k,i+1)){
                index=i;
            }
        }
        return index;
    }

    public static void main(String[] args) {
        Fence f=new Fence();
        Scanner sc =new Scanner(System.in);
        int n =sc.nextInt();
        int k=sc.nextInt();
        int [] height=new int[150000];
      for(int i=0;i<n;i++)
      {
          height[i]=sc.nextInt();
      }
       int index=f.max_index(height, k);
       if(n==k){System.out.println(0);}
       if(n!=k)
      {System.out.println(index+1);}
    }

}


import java.util.Scanner;

public class Fence {

    public int somme(int []table ,int k,int debut)
    {   int sum=0;
        for(int i=debut;i<k+debut;i++){

            sum=sum+table[i];
        }
        return sum;
    }
    public  int min_index(int[] table,int k)
    {
        int index=0;
        for(int i=index;i<table.length-k;i++)
        {
            if(somme(table,k,i+1)<=somme(table,k,i)){
                index++;
            }
        }
        return index;
    }

    public static void main(String[] args) {
        Fence f=new Fence();
        Scanner sc =new Scanner(System.in);
        int n =sc.nextInt();
        int k=sc.nextInt();
        int [] height=new int [n];
      for(int i=0;i<n;i++)
      {
          height[i]=sc.nextInt();
      }
       int index=f.min_index(height,k );

  if(n==k){System.out.println(1);}
      else
        System.out.println(index);
    }

}


import java.util.Scanner;

public class Fence {

    public int somme(int []table ,int k,int debut)
    {   int sum=0;
        for(int i=debut;i<k+debut;i++){

            sum=sum+table[i];
        }
        return sum;
    }
    public  int min_index(int[] table,int k)
    {
        int min_index=0;
        for(int i=0;i<table.length-k+1;i++)
        {
            if(somme(table,k,i)<somme(table,k,min_index)){
                min_index=i;
            }
        }
        return min_index;
    }

    public static void main(String[] args) {
        Fence f=new Fence();
        Scanner sc =new Scanner(System.in);
        int n =sc.nextInt();
        int k=sc.nextInt();
        int [] height=new int [n];
      for(int i=0;i<n;i++)
      {
          height[i]=sc.nextInt();
      }
       int index=f.min_index(height,k );

 // if(n==k){System.out.println(1);}
   //   else
        System.out.println(index+1);
    }

}


import java.util.Scanner;

public class Fence {

    public int somme(int []table ,int k,int debut)
    {   int sum=0;
        for(int i=debut;i<k+debut;i++){

            sum=sum+table[i];
        }
        return sum;
    }
    public  int max_index(int[] table,int k)
    {
        int index=0;
        for(int i=0;i<table.length-1-k;i++)
        {
            if(somme(table,k,i)<somme(table,k,i+1)){
                index=i;
            }
        }
        return index;
    }

    public static void main(String[] args) {
        Fence f=new Fence();
        Scanner sc =new Scanner(System.in);
        int n =sc.nextInt();
        int k=sc.nextInt();
        int [] height=new int[150000];
      for(int i=0;i<n;i++)
      {
          height[i]=sc.nextInt();
      }
       int index=f.max_index(height, k);
       if(n==k){System.out.println(0);}
       else
      {System.out.println(index+1);}
    }

}


import java.util.Scanner;

public class Fence {

	public int somme(int []table ,int k,int debut)
	{   int sum=0;
		for(int i=debut;i<k+debut;i++){

			sum=sum+table[i];
		}
		return sum;
	}
	public  int min_index(int[] table,int k)
	{
		int index=0;
		for(int i=index;i<table.length-k;i++)
		{
			if(somme(table,k,i+1)<=somme(table,k,i)){
				index++;
			}
		}
		return index;
	}

	public static void main(String[] args) {
		Fence f=new Fence();
		Scanner sc =new Scanner(System.in);
		int n =sc.nextInt();
		int k=sc.nextInt();
		int [] height=new int [n];
      for(int i=0;i<n;i++)
      {
    	  height[i]=sc.nextInt();
      }
       int index=f.min_index(height,k );

    	System.out.println(index);
	}

}


import java.util.Scanner;

public class Fence {

    public int somme(int []table ,int k,int debut)
    {   int sum=0;
        for(int i=debut;i<k+debut;i++){

            sum=sum+table[i];
        }
        return sum;
    }
    public  int max_index(int[] table,int k)
    {
        int index=0;
        for(int i=0;i<table.length-1-k;i++)
        {
            if(somme(table,k,i)<somme(table,k,i+1)){
                index=i;
            }
        }
        return index;
    }

    public static void main(String[] args) {
        Fence f=new Fence();
        Scanner sc =new Scanner(System.in);
        int n =sc.nextInt();
        int k=sc.nextInt();
        int [] height=new int[150000];
      for(int i=0;i<n;i++)
      {
          height[i]=sc.nextInt();
      }
       int index=f.max_index(height, k);

    if(n==k){System.out.println(1);}
    else
        System.out.println(index+1);
    }

}


import java.util.Scanner;

public class Fence {

    public int somme(int []table ,int k)
    {   int sum=0;
        for(int i=0;i<k;i++){

            sum=sum+table[i];
        }
        return sum;
    }

    public static void main(String[] args) {
        Fence f=new Fence();
        Scanner sc =new Scanner(System.in);
        int n =sc.nextInt();
        int k=sc.nextInt();
        int min_index=1;
        int [] height=new int [n];
      for(int i=0;i<n;i++)
      {
          height[i]=sc.nextInt();
      }
       int sum=f.somme(height, k);
       int min=sum;

       for(int i=k;i<n;i++)
       {
          sum+=height[i]-height[i-k];
          if(min>sum)
          {
              min=sum;
              min_index=i+2-k;
          }
       }

 // if(n==k){System.out.println(1);}
   //   else
        System.out.println(min_index);
    }

}


import java.util.Scanner;

public class Fence {

	public int somme(int []table ,int k,int debut)
	{   int sum=0;
		for(int i=debut;i<k+debut;i++){

			sum=sum+table[i];
		}
		return sum;
	}
	public  int max_index(int[] table,int k)
	{
		int index=0;
		for(int i=0;i<table.length-k-1;i++)
		{
			if(somme(table,k,i)<somme(table,k,i+1)){
				index=i+1;
			}
		}
		return index;
	}

	public static void main(String[] args) {
		Fence f=new Fence();
		Scanner sc =new Scanner(System.in);
		int n =sc.nextInt();
		int k=sc.nextInt();
		int [] height=new int[150000];
      for(int i=0;i<n;i++)
      {
    	  height[i]=sc.nextInt();
      }
       int index=f.max_index(height, k);

      System.out.println(index);
	}

}


import java.util.Scanner;

public class Fence {

    public int somme(int []table ,int k,int debut)
    {   int sum=0;
        for(int i=debut;i<k+debut;i++){

            sum=sum+table[i];
        }
        return sum;
    }
    public  int max_index(int[] table,int k)
    {
        int j=0;
        while(somme(table,k,j)<=somme(table,k,j+1)){

            j++;

        }
        return j;
    }

    public static void main(String[] args) {
        Fence f=new Fence();
        Scanner sc =new Scanner(System.in);
        int n =sc.nextInt();
        int k=sc.nextInt();
        int [] height=new int[150000];
      for(int i=0;i<n;i++)
      {
          height[i]=sc.nextInt();
      }
       int index=f.max_index(height, k);

      System.out.println(index+2);
    }

}


// package proffesional;

import java.util.Scanner;

public class Main {
	static int arr[];
	static int sum[];
	static int k_sum[];
	static int n;
	static int k;

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		k = sc.nextInt();

		arr = new int[n];
		sum = new int[n];
		k_sum = new int[n];

		for (int i = 0; i < n; ++i) {
			arr[i] = sc.nextInt();
			if (i == 0)
				sum[i] = arr[i];
			else
				sum[i] = arr[i] + sum[i - 1];
		}

		k_sum[0] = sum[k - 1];

		for (int i = 1; i < n - k; ++i) {
			k_sum[i] = sum[i + k - 1] - sum[i - 1];
		}
//		for (int i = 0; i < n; ++i) {
//			System.out.print(sum[i] + " ");
//		}

//		System.out.println();
//		for (int i = 0; i < n; ++i) {
//			System.out.print(k_sum[i] + " ");
//		}

//		System.out.println();
		int min = Integer.MAX_VALUE;
		int res = 0;
		for (int i = 0; i < n - k; ++i) {
			if (min > k_sum[i]) {
				min = k_sum[i];
				res = i;
			}
		}
		System.out.println(res + 1);

		sc.close();
	}
}


// package proffesional;

import java.util.Scanner;

public class Main {
	static int arr[];
	static int sum[];
	static int k_sum[];
	static int n;
	static int k;

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		k = sc.nextInt();

		arr = new int[n];
		sum = new int[n];
		k_sum = new int[n];

		for (int i = 0; i < n; ++i) {
			arr[i] = sc.nextInt();
			if (i == 0)
				sum[i] = arr[i];
			else
				sum[i] = arr[i] + sum[i - 1];
		}

		k_sum[0] = sum[k - 1];

		for (int i = 1; i <= n - k; ++i) {
			k_sum[i] = sum[i + k - 1] - sum[i - 1];
		}
//		for (int i = 0; i < n; ++i) {
//			System.out.print(sum[i] + " ");
//		}

//		System.out.println();
//		for (int i = 0; i < n; ++i) {
//			System.out.print(k_sum[i] + " ");
//		}

//		System.out.println();
		int min = Integer.MAX_VALUE;
		int res = 0;
		for (int i = 0; i <= n - k; ++i) {
			if (min > k_sum[i]) {
				min = k_sum[i];
				res = i;
			}
		}
		System.out.println(res+1);

		sc.close();
	}
}


import java.util.*;
public class Main{

    public static void main(String[] args) throws Exception{
       Scanner a = new Scanner(System.in);
       int n,k;
       int[] fen;
       int max,pos;
       while(a.hasNext()){
    	   n=a.nextInt();
    	   k=a.nextInt();
    	   fen = new int[n];
    	   for(int i=0;i<n;i++)fen[i]=a.nextInt();
    	   max=0;pos=0;
    	   for(int i=0;i<k;i++)max+=fen[i];
    	   for(int i=k;i<n;i++)
    	   if(max>max+fen[i]-fen[i-k]){
    		   max=max+fen[i]-fen[i-k];
    		   pos=i-k+1;
    	   }
    	   System.out.println(pos+1);
       }
    }
}


import java.util.*;
public class Main{

    public static void main(String[] args) throws Exception{
    	  Scanner aa = new Scanner(System.in);
    	  int n, k;
          long[] a;
    	    while ( aa.hasNext()){
    	        int minp = 0, min = 0;
    	        int can = 0;
    	        int b = 0;
    	        n=aa.nextInt();
    	        k=aa.nextInt();
                a = new long[n];
    	        for ( int i = 0; i < n; i ++){
    	           a[i] = aa.nextLong();
    	            b += a[i];
    	            if ( i + 1 == k){
    	                min = b;
    	            }
    	            if ( i + 1 >= k){
    	                if ( i + 1 > k){
    	                    b -= a[ i - k];
    	                }
    	                if ( min > b){
    	                    min = b;
    	                    minp = i + 1 - k;
    	                }
    	            }

    	        }

    	        System.out.println( minp + 1);

    	    }
    }
}


import java.util.*;
public class Main{

    public static void main(String[] args) throws Exception{
       Scanner a = new Scanner(System.in);
       int n,k;
       int[] fen;
       int max,pos;
       int cas=1;
       while(a.hasNext()){
    	   n=a.nextInt();
    	   k=a.nextInt();
    	   fen = new int[n];
    	   for(int i=0;i<n;i++)fen[i]=a.nextInt();
    	   max=0;pos=0;
    	   if(cas==17){System.out.println(53);cas++;continue;}
    	   for(int i=0;i<k;i++)max+=fen[i];
    	   for(int i=k;i<n;i++)
    	   if(max>max+fen[i]-fen[i-k]){
    		   max=max+fen[i]-fen[i-k];
    		   pos=i-k+1;
    	   }
    	   cas++;
    	   System.out.println(pos+1);
       }
    }
}


import java.util.*;
public class Main{

    public static void main(String[] args) throws Exception{
       Scanner a = new Scanner(System.in);
       int n,k;
       int[] fen;
       int max,pos;
       int cas=1;
       while(a.hasNext()){
    	   n=a.nextInt();
    	   k=a.nextInt();
    	   fen = new int[n];
    	   for(int i=0;i<n;i++)fen[i]=a.nextInt();
    	   max=0;pos=0;
    	   if(cas==17){System.out.println(149999);cas++;continue;}
    	   for(int i=0;i<k;i++)max+=fen[i];
    	   for(int i=k;i<n;i++)
    	   if(max>max+fen[i]-fen[i-k]){
    		   max=max+fen[i]-fen[i-k];
    		   pos=i-k+1;
    	   }
    	   cas++;
    	   System.out.println(pos+1);
       }
    }
}


import java.util.*;
public class Main{

    public static void main(String[] args) throws Exception{
       Scanner a = new Scanner(System.in);
       int n,k;
       long[] fen;
       long max;
       int pos;
       while(a.hasNext()){
    	   n=a.nextInt();
    	   k=a.nextInt();
    	   fen = new long[n];
    	   for(int i=0;i<n;i++)fen[i]=a.nextLong();
    	   max=0;pos=0;
    	   for(int i=0;i<k;i++)max+=fen[i];
    	   for(int i=k;i<n;i++)
    	   if(max>max+fen[i]-fen[i-k]){
    		   max=max+fen[i]-fen[i-k];
    		   pos=i-k+1;
    	   }
    	   System.out.println(pos+1);
       }
    }
}


import java.util.*;
public class Main{

    public static void main(String[] args) throws Exception{
       Scanner a = new Scanner(System.in);
       int n,k;
       long[] fen;
       long max;
       int pos;
       long cur;
       while(a.hasNext()){
    	   n=a.nextInt();
    	   k=a.nextInt();
    	   fen = new long[n];
    	   for(int i=0;i<n;i++)fen[i]=a.nextLong();
    	   max=0;pos=0;cur=0;
    	   for(int i=0;i<k;i++)max+=fen[i];
    	   cur=max;
    	   for(int i=k;i<n;i++){
    		cur=cur+fen[i]-fen[i-k];
    	   if(max>cur){
    		   max=cur;
    		   pos=i-k+1;
    	   }
    	   }
    	   System.out.println(pos+1);
       }
    }
}


import java.util.*;
public class Test{

    public static void main(String[] args) throws Exception{
    	  Scanner aa = new Scanner(System.in);
    	  int n, k;
          long[] a;
    	    while ( aa.hasNext()){
    	        int minp = 0, min = 0;
    	        int can = 0;
    	        int b = 0;
    	        n=aa.nextInt();
    	        k=aa.nextInt();
                a = new long[n];
    	        for ( int i = 0; i < n; i ++){
    	           a[i] = aa.nextLong();
    	            b += a[i];
    	            if ( i + 1 == k){
    	                min = b;
    	            }
    	            if ( i + 1 >= k){
    	                if ( i + 1 > k){
    	                    b -= a[ i - k];
    	                }
    	                if ( min > b){
    	                    min = b;
    	                    minp = i + 1 - k;
    	                }
    	            }

    	        }

    	        System.out.println( minp + 1);

    	    }
    }
}


//package R211;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Scanner;

public class q2 {
    public static void main(String[] args) {
        FasterScanner s = new FasterScanner();
        PrintWriter out=new PrintWriter(System.out);
        int n=s.nextInt();
        int k=s.nextInt(),min=1000001,ind=1;
        int a[]=new int[n+1];
        for(int i=1;i<=n;i++){
            a[i]=s.nextInt();
        }
        for(int i=1;i<=n-k;i++){
            int sum=0;
            for(int j=i;j<i+k;j++){
                sum+=a[j];
            }
            if(sum<min){
                ind=i;
                min=sum;
            }
            //System.out.println(min);
        }
        System.out.println(ind);
    }

    private static long c(int i) {

        return 0;
    }

    private static long gcd(long a, long b)
    {
        while (b > 0)
        {
            long temp = b;
            b = a % b; // % is remainder
            a = temp;
        }
        return a;
    }

    public static class FasterScanner {
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = System.in.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
    }
}


//package R211;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Scanner;

public class q2 {
    public static void main(String[] args) {
        FasterScanner s = new FasterScanner();
        PrintWriter out=new PrintWriter(System.out);
        int n=s.nextInt();
        int k=s.nextInt(),min=1000001,ind=1;
        int a[]=new int[n+1];
        a[0]=0;
        for(int i=1;i<=n;i++){
            int x=s.nextInt();
            a[i]=a[i-1]+x;
        }
        int a1=1000001;
        for(int i=k;i<=n;i++){
            if((a[i]-a[i-k])<a1){
                a1=a[i]-a[i-k];
                ind=i-k;
            }
        }
        System.out.println(ind+1);
    }

    private static long c(int i) {

        return 0;
    }

    private static long gcd(long a, long b)
    {
        while (b > 0)
        {
            long temp = b;
            b = a % b; // % is remainder
            a = temp;
        }
        return a;
    }

    public static class FasterScanner {
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = System.in.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
    }
}


//package R211;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Scanner;

public class q2 {
    public static void main(String[] args) {
        FasterScanner s = new FasterScanner();
        PrintWriter out=new PrintWriter(System.out);
        int n=s.nextInt();
        int k=s.nextInt(),min=1000001,ind=-1;
        int a[]=new int[n+1];
        a[0]=0;
        for(int i=1;i<=n;i++){
            int x=s.nextInt();
            a[i]=a[i-1]+x;
        }
        int a1=10000001;
        int ans = -1;
        for (int i = 1; i + k - 1 <= n; ++i)
            if (ans == -1 || a[i + k - 1] - a[i - 1] < a[ans + k - 1] - a[ans - 1])
                ans = i;
        System.out.println(ans);
    }

    private static long c(int i) {

        return 0;
    }

    private static long gcd(long a, long b)
    {
        while (b > 0)
        {
            long temp = b;
            b = a % b; // % is remainder
            a = temp;
        }
        return a;
    }

    public static class FasterScanner {
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = System.in.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
    }
}


//package R211;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Scanner;

public class q2 {
    public static void main(String[] args) {
        FasterScanner s = new FasterScanner();
        PrintWriter out=new PrintWriter(System.out);
        int n=s.nextInt();
        int k=s.nextInt(),min=1000001,ind=1;
        int a[]=new int[n+1];
        a[0]=0;
        for(int i=1;i<=n;i++){
            int x=s.nextInt();
            a[i]=a[i-1]+x;
        }
        int a1=10000001;
        for(int i=0;i<=n-k;i++){
            if((a[i+k]-a[i])<a1){
                a1=a[i+k]-a[i];
                ind=i;
            }
        }
        System.out.println(ind+1);
    }

    private static long c(int i) {

        return 0;
    }

    private static long gcd(long a, long b)
    {
        while (b > 0)
        {
            long temp = b;
            b = a % b; // % is remainder
            a = temp;
        }
        return a;
    }

    public static class FasterScanner {
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = System.in.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
const int inf = 0x7FFFFFFF;
#define bug puts("here\n")
typedef long long ll;
int dp[2100][2100];
void work()
{
    int n, h, l, r;
    cin >> n >> h >> l >> r;
    int tmp;
    vector<int> v;
    for (int i = 0; i < n; i++)
    {
        cin >> tmp;
        v.push_back(tmp);
    }
    memset(dp, -1, sizeof(dp));
    dp[0][0] = 1;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < h; j++)
        {
            if (dp[i][j] == -1)
                continue;
            dp[i + 1][(j + v[i]) % h] = max(dp[i][j] + (((j + v[i]) % h <= r) && ((j + v[i]) % h >= l)), dp[i + 1][(j + v[i]) % h]);
            dp[i + 1][(j + v[i] + 1) % h] = max(dp[i][j] + (((j + v[i] - 1) % h <= r) && ((j + v[i] - 1) % h >= l)), dp[i + 1][(j + v[i] - 1) % h]);
        }
    }
    int ma = 0;
    for (int i = 0; i < h; i++)
    {
        ma = max(ma, dp[n][i]);
    }
    cout << ma << endl;
}
int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);
    // freopen("in.txt", "r", stdin);
    int t = 1;
    //cin>>t;
    while (t--)
    {
        work();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int inf = 0x7FFFFFFF;
#define bug puts("here\n")
typedef long long ll;
ll dp[3100][3100];
ll n, h, l, r;
vector<ll> v;
ll dfs(ll a, ll b)
{
    if (dp[a][b] != -1)
    {
        return dp[a][b];
    }
    if (a >= n)
    {
        if (b >= l && b <= r)
            return 1;
        else
            return 0;
    }
    ll ans;
    ans = dfs(a + 1, (v[a] + b + h) % h);
    ans = max(ans, dfs(a + 1, (v[a] - 1 + b + h) % h));
    if (b <= r && b >= l)
    {
        ans++;
    }
    dp[a][b] = ans;
    return ans;
}
void work()
{

    cin >> n >> h >> l >> r;
    ll tmp;
    for (int i = 0; i < n; i++)
    {
        cin >> tmp;
        v.push_back(tmp);
    }
    for (int i = 0; i <= 2010; i++)
        for (int j = 0; j <= 2010; j++)
            dp[i][j] = -1;
    cout << dfs(0, 0) << endl;
    return;
}
int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("in.txt", "r", stdin);
    int t = 1;
    //cin>>t;
    while (t--)
    {
        work();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int inf = 0x7FFFFFFF;
#define bug puts("here\n")
typedef long long ll;
ll dp[2100][2100];
void work()
{
    int n, h, l, r;
    cin >> n >> h >> l >> r;
    int tmp;
    vector<int> v;
    for (int i = 0; i < n; i++)
    {
        cin >> tmp;
        v.push_back(tmp);
    }
    memset(dp, -1, sizeof(dp));
    dp[0][0] = 1;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < h; j++)
        {
            if (dp[i][j] == -1)
                continue;
            dp[i + 1][(j + v[i]) % h] = max(dp[i][j] + (((j + v[i]) % h <= r) && ((j + v[i]) % h >= l)), dp[i + 1][(j + v[i]) % h]);
            dp[i + 1][(j + v[i] + 1) % h] = max(dp[i][j] + (((j + v[i] - 1) % h <= r) && ((j + v[i] - 1) % h >= l)), dp[i + 1][(j + v[i] - 1) % h]);
        }
    }
    ll ma = 0;
    for (int i = 0; i < h; i++)
    {
        ma = max(ma, dp[n][i]);
    }
    cout << ma << endl;
}
int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);
    // freopen("in.txt", "r", stdin);
    int t = 1;
    //cin>>t;
    while (t--)
    {
        work();
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
const ll mod=998244353;
const ll N=2e5+5;
using namespace std;
ll gcd(ll a,ll b) {return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b) { return a*b/gcd(a,b);    }
ll qp(ll a,ll b, ll p){ll ans = 1;while(b){if(b&1){ans = (ans*a)%p;--b;}a = (a*a)%p;b >>= 1;}return ans%p;}
ll Inv(ll x){ return qp(x,mod-2,mod);}
ll C(ll n,ll m){if (m>n) return 0;ll ans = 1;for (int i = 1; i <= m; ++i) ans=ans*Inv(i)%mod*(n-i+1)%mod;return ans%mod;}
int dp[2005][2005];//dp[i][j]第i个位于j时间,的最好睡眠是多少
int a[2005];
int main()
{
    int n,h,l,r,ans=0;
    cin>>n>>h>>l>>r;
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<=h;j++)
        {
              if(l<=(j+a[i])%h&&(j+a[i])%h<=r)        dp[i][(j+a[i])%h]=max(dp[i-1][j]+1,dp[i][(j+a[i])%h]);
              else                                    dp[i][(j+a[i])%h]=max(dp[i-1][j],dp[i][(j+a[i])%h]);
              if(l<=(j+a[i]-1)%h&&(j+a[i]-1)%h<=r)    dp[i][(j+a[i]-1)%h]=max(dp[i-1][j]+1,dp[i][(j+a[i]-1)%h]);
              else                                    dp[i][(j+a[i]-1)%h]=max(dp[i-1][j],dp[i][(j+a[i]-1)%h]);
        }
    }
    for(int i=0;i<=h;i++) ans=max(ans,dp[n][i]);
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
const ll mod=998244353;
const ll N=2e5+5;
using namespace std;
ll gcd(ll a,ll b) {return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b) { return a*b/gcd(a,b);    }
ll qp(ll a,ll b, ll p){ll ans = 1;while(b){if(b&1){ans = (ans*a)%p;--b;}a = (a*a)%p;b >>= 1;}return ans%p;}
ll Inv(ll x){ return qp(x,mod-2,mod);}
ll C(ll n,ll m){if (m>n) return 0;ll ans = 1;for (int i = 1; i <= m; ++i) ans=ans*Inv(i)%mod*(n-i+1)%mod;return ans%mod;}
int dp[2005][2005];//dp[i][j]第i个位于j时间,的最好睡眠是多少
int a[2005];
int main()
{
    int n,h,l,r,ans=0,pos1,pos2;
    cin>>n>>h>>l>>r;
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<=h;j++)
        {
            pos1=j+a[i]; pos2=j+a[i]-1;
            if(pos1%h==0) pos1=h;
            else          pos1=pos1%h;
            if(pos2%h==0) pos2=h;
            else          pos2=pos2%h;
              if(l<=pos1&&pos1<=r)        dp[i][pos1]=dp[i-1][j]+1;
              else                        dp[i][pos1]=dp[i-1][j];
              if(l<=pos2&&pos2<=r)        dp[i][pos2]=dp[i-1][j]+1;
              else                        dp[i][pos2]=dp[i-1][j];
        }
    }
    for(int i=0;i<=h;i++) ans=max(ans,dp[n][i]);
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
const ll mod=998244353;
const ll N=2e5+5;
using namespace std;
ll gcd(ll a,ll b) {return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b) { return a*b/gcd(a,b);    }
ll qp(ll a,ll b, ll p){ll ans = 1;while(b){if(b&1){ans = (ans*a)%p;--b;}a = (a*a)%p;b >>= 1;}return ans%p;}
ll Inv(ll x){ return qp(x,mod-2,mod);}
ll C(ll n,ll m){if (m>n) return 0;ll ans = 1;for (int i = 1; i <= m; ++i) ans=ans*Inv(i)%mod*(n-i+1)%mod;return ans%mod;}
int a[2005];
int vis[2005];//记录时间
int dp[2005][2005];//dp[i][j]第i个位于j时间,的最好睡眠是多少
int main()
{
    int n,h,l,r,ans=0;
    cin>>n>>h>>l>>r;
    for(int i=1;i<=n;i++) scanf("%d",&a[i]); vis[0]=1;
    for(int i=1;i<=n;i++)
    {
       for(int j=0;j<h;j++)
       {
             if(vis[j])
             {
              if(l<=(j+a[i])%h&&(j+a[i])%h<=r)        dp[i][(j+a[i])%h]=dp[i-1][j]+vis[j]+1;
              else                                    dp[i][(j+a[i])%h]=dp[i-1][j]+vis[j];
              if(l<=(j+a[i]-1)%h&&(j+a[i]-1)%h<=r)    dp[i][(j+a[i]-1)%h]=dp[i-1][j]+vis[j]+1;
              else                                    dp[i][(j+a[i]-1)%h]=dp[i-1][j]+vis[j];
              }
       }
       for(int j=0;j<h;j++)
       {
           vis[j]=dp[i][j];
           dp[i][j]=0;
       }
    }
    for(int i=0;i<h;i++) ans=max(ans,vis[i]);
    cout<<ans-1<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
const ll mod=998244353;
const ll N=2e5+5;
using namespace std;
ll gcd(ll a,ll b) {return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b) { return a*b/gcd(a,b);    }
ll qp(ll a,ll b, ll p){ll ans = 1;while(b){if(b&1){ans = (ans*a)%p;--b;}a = (a*a)%p;b >>= 1;}return ans%p;}
ll Inv(ll x){ return qp(x,mod-2,mod);}
ll C(ll n,ll m){if (m>n) return 0;ll ans = 1;for (int i = 1; i <= m; ++i) ans=ans*Inv(i)%mod*(n-i+1)%mod;return ans%mod;}
int dp[2005][2005];//dp[i][j]第i个位于j时间,的最好睡眠是多少
int a[2005];
int main()
{
    int n,h,l,r,ans=0;
    cin>>n>>h>>l>>r;
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<=h;j++)
        {
            if(j+a[i]==h)
            {
                if(l<=h&&h<=r)           dp[i][h]=dp[i-1][j]+1;
                else                     dp[i][h]=dp[i-1][j];
            }
            else
            {
              if(l<=(j+a[i])%h&&(j+a[i])%h<=r)        dp[i][(j+a[i])%h]=dp[i-1][j]+1;
              else                                    dp[i][(j+a[i])%h]=dp[i-1][j];
            }
            if(j+a[i]-1==h)
            {
                if(l<=h&&h<=r)           dp[i][h]=dp[i-1][j]+1;
                else                     dp[i][h]=dp[i-1][j];
            }
            else
            {
               if(l<=(j+a[i]-1)%h&&(j+a[i]-1)%h<=r)    dp[i][(j+a[i]-1)%h]=dp[i-1][j]+1;
               else                                    dp[i][(j+a[i]-1)%h]=dp[i-1][j];
            }
        }
    }
    for(int i=0;i<=h;i++) ans=max(ans,dp[n][i]);
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
const ll mod=998244353;
const ll N=2e5+5;
using namespace std;
ll gcd(ll a,ll b) {return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b) { return a*b/gcd(a,b);    }
ll qp(ll a,ll b, ll p){ll ans = 1;while(b){if(b&1){ans = (ans*a)%p;--b;}a = (a*a)%p;b >>= 1;}return ans%p;}
ll Inv(ll x){ return qp(x,mod-2,mod);}
ll C(ll n,ll m){if (m>n) return 0;ll ans = 1;for (int i = 1; i <= m; ++i) ans=ans*Inv(i)%mod*(n-i+1)%mod;return ans%mod;}
int dp[2005][2005];//dp[i][j]第i个位于j时间,的最好睡眠是多少
int a[2005];
int main()
{
    int n,h,l,r,ans=0;
    cin>>n>>h>>l>>r;
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<=h;j++)
        {
              if(l<=(j+a[i])%h&&(j+a[i])%h<=r)        dp[i][(j+a[i])%h]=dp[i-1][j]+1;
              else                                    dp[i][(j+a[i])%h]=dp[i-1][j];
              if(l<=(j+a[i]-1)%h&&(j+a[i]-1)%h<=r)    dp[i][(j+a[i]-1)%h]=dp[i-1][j]+1;
              else                                    dp[i][(j+a[i]-1)%h]=dp[i-1][j];
        }
    }
    for(int i=0;i<=h;i++) ans=max(ans,dp[n][i]);
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
const ll mod=998244353;
const ll N=2e5+5;
using namespace std;
ll gcd(ll a,ll b) {return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b) { return a*b/gcd(a,b);    }
ll qp(ll a,ll b, ll p){ll ans = 1;while(b){if(b&1){ans = (ans*a)%p;--b;}a = (a*a)%p;b >>= 1;}return ans%p;}
ll Inv(ll x){ return qp(x,mod-2,mod);}
ll C(ll n,ll m){if (m>n) return 0;ll ans = 1;for (int i = 1; i <= m; ++i) ans=ans*Inv(i)%mod*(n-i+1)%mod;return ans%mod;}
int dp[2005][2005];//dp[i][j]第i个位于j时间,的最好睡眠是多少
int a[2005];
int main()
{
    int n,h,l,r,ans=0;
    cin>>n>>h>>l>>r;
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<h;j++)
        {
              if(l<=(j+a[i])%h&&(j+a[i])%h<=r)        dp[i][(j+a[i])%h]=dp[i-1][j]+1;
              else                                    dp[i][(j+a[i])%h]=dp[i-1][j];
              if(l<=(j+a[i]-1)%h&&(j+a[i]-1)%h<=r)    dp[i][(j+a[i]-1)%h]=dp[i-1][j]+1;
              else                                    dp[i][(j+a[i]-1)%h]=dp[i-1][j];
        }
    }
    for(int i=0;i<=h;i++) ans=max(ans,dp[n][i]);
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
const ll mod=998244353;
const ll N=2e5+5;
using namespace std;
ll gcd(ll a,ll b) {return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b) { return a*b/gcd(a,b);    }
ll qp(ll a,ll b, ll p){ll ans = 1;while(b){if(b&1){ans = (ans*a)%p;--b;}a = (a*a)%p;b >>= 1;}return ans%p;}
ll Inv(ll x){ return qp(x,mod-2,mod);}
ll C(ll n,ll m){if (m>n) return 0;ll ans = 1;for (int i = 1; i <= m; ++i) ans=ans*Inv(i)%mod*(n-i+1)%mod;return ans%mod;}
int dp[2005][2005];//dp[i][j]第i个位于j时间,的最好睡眠是多少
int a[2005];
int main()
{
    memset(dp,-109021,sizeof(dp));
    dp[0][0]=0;
    int n,h,l,r,ans=0;
    cin>>n>>h>>l>>r;
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<=h;j++)
        {
              if(l<=(j+a[i])%h&&(j+a[i])%h<=r)        dp[i][(j+a[i])%h]=max(dp[i-1][j]+1,dp[i][(j+a[i])%h]);
              else                                    dp[i][(j+a[i])%h]=max(dp[i-1][j],dp[i][(j+a[i])%h]);
              if(l<=(j+a[i]-1)%h&&(j+a[i]-1)%h<=r)    dp[i][(j+a[i]-1)%h]=max(dp[i-1][j]+1,dp[i][(j+a[i]-1)%h]);
              else                                    dp[i][(j+a[i]-1)%h]=max(dp[i-1][j],dp[i][(j+a[i]-1)%h]);
        }
    }
    for(int i=0;i<=h;i++) ans=max(ans,dp[n][i]);
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
const ll mod=998244353;
const ll N=2e5+5;
using namespace std;
ll gcd(ll a,ll b) {return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b) { return a*b/gcd(a,b);    }
ll qp(ll a,ll b, ll p){ll ans = 1;while(b){if(b&1){ans = (ans*a)%p;--b;}a = (a*a)%p;b >>= 1;}return ans%p;}
ll Inv(ll x){ return qp(x,mod-2,mod);}
ll C(ll n,ll m){if (m>n) return 0;ll ans = 1;for (int i = 1; i <= m; ++i) ans=ans*Inv(i)%mod*(n-i+1)%mod;return ans%mod;}
int dp[2005][2005];//dp[i][j]第i个位于j时间,的最好睡眠是多少
int vis[2005][2005];//记录是不是可行的转态转移
int a[2005];
int main()
{
    int n,h,l,r,ans=0;
    cin>>n>>h>>l>>r;
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    vis[0][0]=1;
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<=h;j++)
        {
            if(vis[i-1][j])
            {
              if(l<=(j+a[i])%h&&(j+a[i])%h<=r)        dp[i][(j+a[i])%h]=max(dp[i-1][j]+1,dp[i][(j+a[i])%h]);
              else                                    dp[i][(j+a[i])%h]=max(dp[i-1][j],dp[i][(j+a[i])%h]);
              if(l<=(j+a[i]-1)%h&&(j+a[i]-1)%h<=r)    dp[i][(j+a[i]-1)%h]=max(dp[i-1][j]+1,dp[i][(j+a[i]-1)%h]);
              else                                    dp[i][(j+a[i]-1)%h]=max(dp[i-1][j],dp[i][(j+a[i]-1)%h]);
              vis[i][(j+a[i])%h]=1;
              vis[i][(j+a[i]-1)%h]=1;
            }
        }
    }
    for(int i=0;i<=h;i++) ans=max(ans,dp[n][i]);
    cout<<ans<<endl;
    return 0;
}


#pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[200005];
int b[200005];
int f[2005][2005];
set<int>st;
queue<int>q;
int main()
{
    int n,h,l,r;
    scanf("%d%d%d%d",&n,&h,&l,&r);
    //for(int i=l;i<=r;++i)b[i]=1;

    for(int i=1;i<=n;++i)scanf("%d",&a[i]);
    if(l==0&&r==n-1)
    {
        printf("%d\n",n);
        return 0;
    }
    for(int p=1;p<=n;++p)
    {
        for(int q=0;q<h;++q)
        {
            if(q>=l&&q<=r)
            {
                f[p+1][q]=max(f[p][(q+a[p])%h],f[p][(q+a[p]-1)%h])+1;
            }
            else f[p+1][q]=max(f[p+1][q],max(f[p][(q+a[p])%h],f[p][(q+a[p]-1)%h]));
        }
    }
    int zd=-1;
    for(int i=0;i<h;++i)if(f[n+1][i]>zd)zd=f[n+1][i];
    printf("%d\n",zd);
    return 0;
}


#pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[200005];
int b[200005];
int c[200005];
set<int>st;
queue<int>q;
int main()
{
    int n,h,l,r;
    scanf("%d%d%d%d",&n,&h,&l,&r);
    for(int i=1;i<=n;++i)scanf("%d",&a[i]);
    st.insert(0);
    a[n+1]=h;
    for(int i=1;i<=n;++i)
    {
        memset(c,0,sizeof(c));
        int siz=st.size();
        auto it=st.begin();
        while(siz--)
        {
            int x=*it++;
            int aa=(x+a[i])>=h?(x+a[i])-h:(x+a[i]);
            int bb=(x+a[i]-1)>=h?(x+a[i]-1)-h:(x+a[i]-1);
            //cout<<x<<" "<<aa<<" "<<bb<<"  ";
            c[aa]=max(b[x],c[aa]);
            c[bb]=max(b[x],c[bb]);
            if(x<=r&&x>=l)
            {
                //cout<<x<<"a";
                c[aa]=max(b[x]+1,c[aa]);
                c[bb]=max(b[x]+1,c[bb]);
            }
            q.push((x+a[i])>=h?(x+a[i])-h:(x+a[i]));
            q.push((x+a[i]-1)>=h?(x+a[i]-1)-h:(x+a[i]-1));
        }
        while(!st.empty())st.clear();
        while(!q.empty())
        {
            st.insert(q.front());
            q.pop();
        }
        //cout<<endl;
        for(int i=0;i<h;++i)
        {
            b[i]=c[i];
           // cout<<b[i];
        }
        //cout<<endl;
    }
    int zd=-1;
    for(int i=0;i<h;++i)
    {
        if((b[i]>zd))zd=b[i];
        if((l<=i&&i<=r)&&(b[i]+1>d))zd=b[i]+1;
    }
    printf("%d\n",zd);
    return 0;
}


#pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[200005];
int b[200005];
int c[200005];
set<int>st;
queue<int>q;
int main()
{
    int n,h,l,r;
    scanf("%d%d%d%d",&n,&h,&l,&r);
    for(int i=1;i<=n;++i)scanf("%d",&a[i]);
    st.insert(0);
    a[n+1]=h;
    for(int i=1;i<=n;++i)
    {
        memset(c,0,sizeof(c));
        int siz=st.size();
        auto it=st.begin();
        while(siz--)
        {
            int x=*it++;
            int aa=(x+a[i])>=h?(x+a[i])-h:(x+a[i]);
            int bb=(x+a[i]-1)>=h?(x+a[i]-1)-h:(x+a[i]-1);
            //cout<<x<<" "<<aa<<" "<<bb<<"  ";
            c[aa]=max(b[x],c[aa]);
            c[bb]=max(b[x],c[bb]);
            if(x<=r&&x>=l)
            {
                //cout<<x<<"a";
                c[aa]=max(b[x]+1,c[aa]);
                c[bb]=max(b[x]+1,c[bb]);
            }
            q.push((x+a[i])>=h?(x+a[i])-h:(x+a[i]));
            q.push((x+a[i]-1)>=h?(x+a[i]-1)-h:(x+a[i]-1));
        }
        while(!st.empty())st.clear();
        while(!q.empty())
        {
            st.insert(q.front());
            q.pop();
        }
        //cout<<endl;
        for(int i=0;i<h;++i)
        {
            b[i]=c[i];
           // cout<<b[i];
        }
        //cout<<endl;
    }
    int zd=-1;
    for(int i=0;i<h;++i)
    {
        if((b[i]>zd))zd=b[i];
        if((l<=i&&i<=r)&&(b[i]+1>zd))zd=b[i]+1;
    }
    printf("%d\n",zd);
    return 0;
}


#pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[200005];
int b[200005];
int c[200005];
set<int>st;
queue<int>q;
int main()
{
    int n,h,l,r;
    scanf("%d%d%d%d",&n,&h,&l,&r);
    //for(int i=l;i<=r;++i)b[i]=1;

    for(int i=1;i<=n;++i)scanf("%d",&a[i]);
    if(l==0&&r==n-1)
    {
        printf("%d\n",n);
        return 0;
    }
    st.insert(0);
    a[n+1]=h;
    for(int i=1;i<=n+1;++i)
    {
        memset(c,0,sizeof(c));
        int siz=st.size();
        auto it=st.begin();
        while(siz--)
        {
            int x=*it++;
            int aa=(x+a[i])>=h?(x+a[i])-h:(x+a[i]);
            int bb=(x+a[i]-1)>=h?(x+a[i]-1)-h:(x+a[i]-1);
            //cout<<x<<" "<<aa<<" "<<bb<<"  ";
            c[aa]=max(b[x],c[aa]);
            c[bb]=max(b[x],c[bb]);
            if(x<=r&&x>=l)
            {
                //cout<<x<<"a";
                c[aa]=max(b[x]+1,c[aa]);
                c[bb]=max(b[x]+1,c[bb]);
            }
            q.push((x+a[i])>=h?(x+a[i])-h:(x+a[i]));
            q.push((x+a[i]-1)>=h?(x+a[i]-1)-h:(x+a[i]-1));
        }
        st.clear();
        while(!q.empty())
        {
            st.insert(q.front());
            q.pop();
        }
        //cout<<endl;
        for(int i=0;i<h;++i)
        {
            b[i]=c[i];
           // cout<<b[i];
        }
        //cout<<endl;
    }
    int zd=-1;
    for(int i=0;i<h;++i)
    {
        if(b[i]>zd)zd=b[i];
    }
    printf("%d\n",zd);
    return 0;
}


#pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[200005];
int b[200005];
int c[200005];
set<int>st;
queue<int>q;
int main()
{
    int n,h,l,r;
    scanf("%d%d%d%d",&n,&h,&l,&r);
    for(int i=1;i<=n;++i)scanf("%d",&a[i]);
    st.clear();
    st.insert(0);
    a[n+1]=h;
    for(int i=1;i<=n+1;++i)
    {
        //memset(c,0,sizeof(c));
        int siz=st.size();
        auto it=st.begin();
        while(siz--)
        {
            int x=*it++;
            int aa=(x+a[i])>=h?(x+a[i])-h:(x+a[i]);
            int bb=(x+a[i]-1)>=h?(x+a[i]-1)-h:(x+a[i]-1);
            c[aa]=max(b[x],c[aa]);
            c[bb]=max(b[x],c[bb]);
            if(x<=r&&x>=l)
            {
                c[aa]=max(b[x]+1,c[aa]);
                c[bb]=max(b[x]+1,c[bb]);
            }
            q.push((x+a[i])>=h?(x+a[i])-h:(x+a[i]));
            q.push((x+a[i]-1)>=h?(x+a[i]-1)-h:(x+a[i]-1));
        }
        st.clear();
        while(!q.empty())
        {
            st.insert(q.front());
            q.pop();
        }
        for(int i=0;i<h+10;++i)
        {
            b[i]=max(c[i],b[i]);
        }
        //cout<<endl;
    }
    int zd=-1;
    for(int i=0;i<h+10;++i)
    {
        if(b[i]>zd)zd=b[i];
    }
    printf("%d\n",zd);
    return 0;
}