Given n numbers , you earn points by deleting numbers from the array. When deleting a number , you earn points. Yet, you must delete all the numbers equal to and from the array (those do not earn you points).

What would be the maximum possible points you can get?

Input

The input contains a single integer n (1 ≤ n ≤ ).

The next line contains n space-separated integers (1 ≤ ≤ ).

Output

The program should print the maximum possible points you can get.