St Andrews Online Judge

Object Eraser

By Kay Akashi

Time: 2000 ms
Memory: 256000 kB

The code judging system is only available during contests. Check out the github repo for test cases and solutions.

Please log in.

Problem Statement

Japanese alphabets are often more complex than those of English, thus each of them has multiple "strokes". For example, "depression" in Japanese is "鬱" that requires 2929 strokes.

Kay has written a sentence in Japanese on his tablet. Now, Kay knows his sentence consists of NN characters, and ii-th character has AiA_i characters.

His tablet has a function called "object eraser" which enables him to delete the last stroke from the last character. After deleting all the strokes in a single character, the character is completely erased.

He says he is going to press the object eraser button KK times, but is unsure how many characters are going to be completely erased. Tell him the answer.

Constraints

1N1051 \leq N \leq 10^{5}. 0K10120 \leq K \leq 10^{12}. 1Ai1091 \leq A_i \leq 10^{9} (1iN1 \leq i \leq N).

Apologies for unrealistic constraints (no Japanese character requires as many as 11 billion strokes in reality).

Input

The first line of input contains two integers, NN and KK. The second line of input contains NN integers, A1,A2,...,ANA_1, A_2, ..., A_N.

Output

Output a single integer, the number of characters being erased completely.

Examples

Input

5 6
3 2 5 2 2

Output

2

Explanation

The sentence is "ありがとう" (arigatou, meaning "thank you"). After pressing the button 66 times, the last two characters are completely gone, but the third letter remains undeleted, only to transfer "が" to "か".

Input

2 12
7 5

Output

2

Explanation

"寿司" (sushi, meaning "sushi"). Every character is gone after pressing the button 1212 times because the word as a whole consists of 1212 strokes.

Input

29 40
12 9 3 3 3 2 2 3 1 2 3 15 14 1 1 1 2 1 3 2 5 2 2 4 5 2 3 2 1

Output

16

Explanation

"最後までテストケースを確認してくれてありがとうございます。" (well, just use a translator if you're interested).