The contest is beginning again! To make the contest more interesting, Competition Commission has developed a new rule: There are N problems initially, and for each problem, if one get an "Accepted", he can get some points, equal to the number of contestants that did not solve the problem. The score of each contestant was equal to the sum of points assigned to the problems solved by that contestant.
iSea participated in the contest, but he is confused by the complicated scoring rules, and now he is staring at the results, unable to determine his place in the final standings. Help iSea by writing a program that calculates his score and his ranking.
Before the contest, the contestants were assigned unique IDs from 1 to S inclusive, and iSea's ID was P. The final standings of the competition list the contestants in descending order of their scores. In case of a tie, among the tied contestants, those who have solved more tasks will be listed ahead of those who have solved fewer tasks. In case of a tie by this criterion as well, the contestants with equal results will be listed in ascending order of their IDs.