Codeforces Round 356 (Div. 2)
A
Bear and Five Cards
Codeforces
800
原题
←B →
翻译中…

A little bear Limak plays a game. He has five cards. There is one number written on each card. Each number is a positive integer.

翻译中…

Limak can discard (throw out) some cards. His goal is to minimize the sum of numbers written on remaining (not discarded) cards.

翻译中…

He is allowed to at most once discard two or three cards with the same number. Of course, he won't discard cards if it's impossible to choose two or three cards with the same number.

翻译中…

Given five numbers written on cards, cay you find the minimum sum of numbers on remaining cards?

翻译中…

Input

翻译中…

The only line of the input contains five integers $*t*_{1}$, $*t*_{2}$, $*t*_{3}$, $*t*_{4}$ and $*t*_{5}$ ($1 ≤ *t*_{*i*} ≤ 100$) — numbers written on cards.

翻译中…

Output

翻译中…

Print the minimum possible sum of numbers written on remaining cards.

翻译中…

Note

翻译中…

In the first sample, Limak has cards with numbers $7$, $3$, $7$, $3$ and $20$. Limak can do one of the following.

翻译中…
  • Do nothing and the sum would be $7 + 3 + 7 + 3 + 20 = 40$.
  • Remove two cards with a number $7$. The remaining sum would be $3 + 3 + 20 = 26$.
  • Remove two cards with a number $3$. The remaining sum would be $7 + 7 + 20 = 34$.
翻译中…

You are asked to minimize the sum so the answer is $26$.

翻译中…

In the second sample, it's impossible to find two or three cards with the same number. Hence, Limak does nothing and the sum is $7 + 9 + 1 + 3 + 8 = 28$.

翻译中…

In the third sample, all cards have the same number. It's optimal to discard any three cards. The sum of two remaining numbers is $10 + 10 = 20$.

翻译中…

样例

Input #1
7 3 7 3 20
Output #1
26
InputCopy OutputCopy
Input #2
7 9 3 1 8
Output #2
28
InputCopy OutputCopy
Input #3
10 10 10 10 10
Output #3
20
InputCopy OutputCopy
题目信息
题号
680A
时间限制
2 s
内存限制
256 MB
标签
构造
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。