AT_abc455_c [ABC455C] Vanish

Description

You are given an integer sequence $ A = (A_1, A_2, \ldots, A_N) $ . Find the minimum possible sum of all elements of $ A $ after performing the following operation exactly $ K $ times. - Choose an integer $ x $ . For each $ i $ such that $ A_i = x $ , replace the value of $ A_i $ with $ 0 $ .

Input Format

The input is given from Standard Input in the following format: > $ N $ $ K $ > $ A_1 $ $ A_2 $ $ \ldots $ $ A_N $

Output Format

Output the answer.

Explanation/Hint

### Sample Explanation 1 Initially, $ A = (7, 2, 7, 2, 2, 9) $ . Performing the operation with $ x = 9 $ gives $ A = (7, 2, 7, 2, 2, 0) $ . Next, performing the operation with $ x = 7 $ gives $ A = (0, 2, 0, 2, 2, 0) $ . At this point, the sum of all elements of $ A $ is $ 0 + 2 + 0 + 2 + 2 + 0 = 6 $ . ### Constraints - $ 1 \leq K \leq N \leq 3 \times 10^5 $ - $ 1 \leq A_i \leq 10^9 $ - All input values are integers.