P1046 [NOIP 2005 Junior] Taotao Picks Apples

Description

There is an apple tree in Taotao’s yard. Every autumn the tree bears $10$ apples. When the apples ripen, Taotao goes to pick them. Taotao has a $30$-centimeter-tall stool; when she cannot reach an apple directly with her hand, she will step on the stool and try again. Now you are given the heights above the ground of the $10$ apples, and the maximum height Taotao can reach when she stretches out her hand. Please help Taotao calculate how many apples she can pick. Assume that if she touches an apple, it will fall.

Input Format

The input consists of two lines of data. The first line contains $10$ integers between $100$ and $200$ inclusive (in centimeters), representing the heights above the ground of the $10$ apples, separated by single spaces. The second line contains a single integer between $100$ and $120$ inclusive (in centimeters), representing the maximum height Taotao can reach when she stretches out her hand.

Output Format

Output a single line containing one integer, which is the number of apples Taotao can pick.

Explanation/Hint

[Source] NOIP 2005 Junior, Problem 1. Translated by ChatGPT 5