Artificial Intelligence


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C++, Java, Python

That AI exam was brutal, wasn't it? As the University of Adelaide's newest AI lecturer, these test scores aren't looking great. If you handed these over to the academic board, they'd tear you to shreds! You need to find a way to look less like a failure.

You can't just give everyone points, that'd raise way too many eyebrows. But maybe you could shuffle them around? Take some marks from the top scorers and give them to the ones struggling. Who could tell?

The exam is out of 100 points, and a student needs 50 to pass. What's the highest number of students you can make pass by redistributing their points?

Input

The first line contains an integer, n (1 \leq n \leq 10^5), the number of students who took the AI exam.

The next line contains n integers X_i (1 \leq X_i \leq 100), the score of the ith student who took the exam.

Output

Output the number of students who could pass the exam, by redistributing their marks while keeping their total score the same.

Example

Input 1
4
65 40 20 60
Output 1
3

Take 15 marks from the first student, and give them to the second student. The final scores are:

  • 65 - 15 = 50, pass
  • 40 + 15 = 55, pass.
  • 20, fail.
  • 60, pass.

So, 3 students pass. It can be shown that this is the maximum number.

Input 2
3
45 45 45
Output 2
2
Input 3
3
90 10 40
Output 3
2

Comments

There are no comments at the moment.