Registered Users Only

Problem Description

Jiahai is making a potato salad today! In fact, just for this purpose, he is harvesting potatoes from his very own potato farm today. Being incredibly adept at picking potatoes, he has managed to pick up N potatoes from the potato farm.

However, his culinary competition is coming up in D days! This culinary competition involves making as much mashed potato as possible. However, he can only process one potato a day. He has a set of N potatoes from the potato farm, each with a different mass. A potato with mass M kg can be made into M kg of mashed potato.

Given the set of potatoes that he has collected and their respective masses, calculate the maximum amount of mashed potato (in kg) he can make at the end of D days.

PS: This is based on a true story. In fact, here is a poster of JPF in real life:

Input

The first line of input will contain two integers, N and D.
The second line of input will contain N integers, with the ith integer representing the mass of the ith potato.

Output

Your output should contain one integer, the maximum amount of mashed potato he can make.