Cossack Vus and the Shop
After moving to a big city, Kozak Vus decided to start a small business by opening a jewelry store. He has pieces of jewelry, with the price of the -th piece being .
Due to the epidemic, jewelry sales have declined, prompting Kozak Vus to launch a promotional sale. Under this promotion, a customer can:
Select a positive number .
Purchase all pieces of jewelry priced at least for a total of coins. This means each piece with is bought for coins.
Kozak Vus wants to know the maximum amount he can receive from this promotional offer.
Input
The first line contains a single integer () — the number of jewelry pieces Kozak Vus has.
The second line contains integers () — the price of the -th piece.
Output
Output a single integer — the maximum number of coins Kozak Vus can earn from this promotion, which is the maximum value of , where is a positive integer, and is the number of jewelry pieces such that .
Examples
Note
In the first example, you can choose , for which there are pieces with a price not less than .
In the second example, you can choose and buy all.
Scoring
Each test is scored separately. You can earn points on tests where .