Under construction

Still being built. Things may change

Cramming

Time limit1sMemory limit1024 MB

Summary
Given chapter study times, simulate 30-minute study blocks that cut off the current chapter when a block ends, and count chapters studied at least half.
Level

Medium4 of 10

Topics
Simulation, Implementation, Math, Greedy
Solved
No attempts yet

Problem

Jihwan, who can leave his body at will, attended class but did not listen to the lecture. As always, exam period comes around, and Jihwan has only now started studying.

He has to study NN chapters in order, and studying the ii-th chapter takes TiT_i minutes. But he does not have much time, so he cannot cover all of them. He has no choice but to use the cramming method to at least avoid an F.

The cramming method is to study for 3030 minutes, take a break, and then start studying for another 3030 minutes. As soon as he finishes studying a chapter completely, he starts studying the next chapter. The reason this method is called cramming is that there is one more important rule. The\mathbf{The} moment the 3030-minute study period ends, he slams the chapter he was studying shut and moves on!

Fortunately, before the exam he was able to study all NN chapters in order using the cramming method. Thinking it was easier than expected, Jihwan went straight out to drink. But perhaps this is the limit of the cramming method? Unfortunately, after drinking, everything except the chapters he had studied at least half of was erased from his head. Feeling dazed, Jihwan began counting how many chapters remained in his head. Help Jihwan, who is suffering from a hangover, by finding the number of chapters he studied at least half of.

Input

The first line gives NN. (1≤N≤1001 \le N \le 100)

From the second line, NN lines give the integer TiT_i in order. (1≤Ti≤1001 \le T_i \le 100)

Output

Print the number of chapters Jihwan studied at least half of.

Examples2

  1. Example 1

    Input
    5
    10
    20
    30
    40
    50
    
    Expected output
    5
    
  2. Example 2

    Input
    5
    20
    40
    60
    80
    100
    
    Expected output
    2