Under construction

Still being built. Things may change

Gahui and Sousenkyo 1

Time limit1sMemory limit512 MB

Summary
Given the votes of ranks 16 to 20, count the characters outside the top 16 whose votes are within 1,000 of the 16th-place total.
Level

Easy2 of 10

Topics
Implementation, Array
Solved
No attempts yet

Problem

Gahui is watching the annual character election. After the election, the top 16 characters, who make up the Tier 1 section (ranks 1 to 16), receive large benefits for one year. Fans therefore vote passionately to push their favorite characters into the top 16. Remarkably, at least one Cinderella appears in every election and achieves an outstanding result.

The competition rate of the election is the number of characters that satisfy both conditions below:

  • The character does not belong to the Tier 1 section.
  • The difference in votes between the character and the 16th-ranked character is 1 0001\,000 or less.

Find the competition rate of the election.

Input

The votes of the characters ranked 16th through 20th are given on one line, separated by spaces.

Output

Print the answer.

Constraints

  • The difference in votes between the 16th-ranked and 20th-ranked characters is 1 0001\,000 or more.
  • No two characters received the same number of votes.
  • 30 000<Number of votes from the 16th-ranked character to the 20th-ranked character≤45 00030\,000 < \text{Number of votes from the 16th-ranked character to the 20th-ranked character} \le 45\,000

Examples2

  1. Example 1

    Input
    40060 40000 39800 38996 37737
    
    Expected output
    2
    
  2. Example 2

    Input
    43300 39800 38900 36500 33500
    
    Expected output
    0