#P1046. [NOIP 2005 普及组] 陶陶摘苹果

[NOIP 2005 普及组] 陶陶摘苹果

[NOIP 2005 Popularization Group] TaoTao Picks Apples

Problem Source

Luogu P1046

Problem Description

There is an apple tree in TaoTao's yard. Every autumn it bears 1010 apples. When the apples ripen, TaoTao runs to pick them. TaoTao has a 3030-centimeter stool. When she cannot reach an apple with her hand, she steps on the stool and tries again.

Now we know the heights of the 1010 apples above the ground, as well as the maximum height TaoTao can reach when she stretches her hand up. Please help TaoTao calculate how many apples she can pick. Assume that whenever she touches an apple, it falls down.

Input Format

The input consists of two lines. The first line contains 1010 integers between 100100 and 200200 (inclusive), representing the heights of the 1010 apples above the ground, separated by single spaces. The second line contains a single integer between 100100 and 120120 (inclusive), representing the maximum height TaoTao can reach when stretching her hand up.

Output Format

The output consists of a single line containing a single integer: the number of apples TaoTao can pick.

Sample Input

100 200 150 140 129 134 167 198 200 111
110

Sample Output

5

Hint

Source: First problem of the NOIP 2005 Popularization Group.