There are people and chairs, both numbered from to . Initially, person sits on chair .
Chair has size . Person can sit on any chair whose size is at least . It is guaranteed that .
Reassign the chairs so that each person occupies exactly one chair, each chair is occupied by exactly one person, and everyone fits in their assigned chair.
Find the maximum number of people who can receive a chair different from their original chair. Chairs are distinct even when their sizes are equal.
Assign chair to person , chair to person , and chair to person . Everyone receives a different chair.
Person keeps chair . People and can exchange their chairs, so the answer is .