Find the substring with the most 1's in a sequence Introduction

I want to find the substring with the most 1's in a sequence of 0's and 1's.

Input

Your program has two inputs, the sequence and the substring length.

The sequence is any number of 0's and 1's:

01001010101101111011101001010100010101101010101010101101101010010110110110


The substring length is any positive non-zero integer:

5


Output

Your program should output the starting index of the first substring of the given length that contains the most 1's. With the above input, the output is:

10


The first character in the string starts at an index of 0.

Scoring

Shortest code wins!

Rules


Your program must always output the correct index for any valid inputs.
You can pick your input/output method from any answer with positive score on the default options. Please specify the method you pick in your answer.
Dyalog APL, 11

(-∘1+⍳⌈/)+/


Try it here. Usage:

   f ← (-∘1+⍳⌈/)+/
   4 f 0 1 1 0 1 1 1 0 0 0 0 1 1
1


Explanation

This is a dyadic (meaning binary) function that takes the substring length from the left, and the sequence from the right. Its structure is the following:

   ┌───┴────┐
 ┌─┴──┐     /
 ∘  ┌─┼─┐ ┌─┘
┌┴┐ + ⍳ / +  
- 1   ┌─┘    
      ⌈      


Explanation by explosion:

(-∘1+⍳⌈/)+/
(       )+/  ⍝ Take sums of substrings of given length, and feed to function in parentheses
    + ⌈/     ⍝ The array of sums itself, and its maximum
     ⍳       ⍝ First index of right argument in left
 -∘1         ⍝ Subtract 1 (APL arrays are 1-indexed)


As an example, let's take 4 and 0 1 1 0 1 1 1 0 as inputs. First we apply the function +/ to them and get 2 3 3 3 3. Then, + and ⌈/ applied to this array give itself and 3, and 2 3 3 3 3 ⍳ 3 evaluates to 2, since 3 first occurs as the second element. We subtract 1 and get 1 as the final result.