LaunchpadSliding window

L4: Launch Window

The sleigh can only launch from Orimovo when the solar wind is right. Your input has two lines: target N, then the wind readings as positive integers separated by commas. Readings are numbered from position 1.

Find the first run of exactly 5 consecutive readings whose sum is exactly the target, and give the position of its first reading. Your input always has at least one. For example:

target 20
3,1,4,1,5,9,2,6,5,3,5

The runs starting at positions 1 and 2 sum to 14 and 20, so the answer is 2.

At what position does the first matching run of 5 start?