A levels are just over and Mr. Panda wants to know how well he has scored for his exams. Scores for A levels are measured in terms of University Admission Scores (UAS), which ranges from 0 to 90, taking on only integral values.
The calculation for UAS is quite complicated due to the different combination of content subjects any student can take. There are H2 content subjects which are worth a maximum of 20 points each in the UAS and H1 content subjects that are worth a maximum of half the points of H2, 10 points.
Out of these subjects, students must take H1 Project Work. They must also take either H1 General Paper or H2 Knowledge and Inquiry but not both. Apart from these, students that take General Paper also have the option to take up another additional 3 H2 and 1 H1 subject or 4 additional H2 subjects.
However, an Knowledge and Inquiry (KI) student cannot take up 4 additional H2 subjects but can instead opt for 3 additional H2 subjects only or 3 additional H2 subjects plus 1 H1 subject.
Yet, since a H2 subject is worth 20 points and a H1 subject is worth 10 points, some subject combination will lead to a total maximum UAS of 100. In this case, the worst performing H2 subject will be considered as a H1 subject, i.e. worth only 10 points.
For each H2 subject, different points are awarded for different grades that the student gets.
The grades will be converted to the points as per the table and accumulated to form the UAS. If the UAS isn't an integal value, then it would be the next highest integral value of the total points accumulated via the table.
The input will be a single string, the grades of H2 subjects followed by the grades of H1 subjects. It will be separated by a slash. (See Sample)
A single integer, the UAS of the A level grades.
Sample Testcase 1
The score for the UAS is 20 + 20 + 20 + 6.25 (H2 counted as H1) + 10 + 6.25 = 82.5 ~> 83
Sample Testcase 2
The score for the UAS is 5 + 10 + 20 + 8.75 + 10 + 6.25 = 60