python3 Solution
\n\nclass Solution:\n    def maximizeGreatness(self, nums: List[int]) -> int:\n        nums.sort()\n        ans=0\n        for num in nums:\n            if num>
\n```\nclass Solution:\n    def maximizeGreatness(self, nums: List[int]) -> int:\n        nums.sort()\n        ans=0\n        for num in nums:\n            if num>nums[ans]:\n                ans+=1\n\n        return ans        \n```
['Python', 'Python3']