题库练习 Bear and Five Cards
← 上一题 下一题 →

A10404 | Bear and Five Cards

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

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?

输入格式

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.

输出格式

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

输入输出样例

输入 #1
7 3 7 3 20
输出 #1
26
输入 #2
7 9 3 1 8
输出 #2
28
输入 #3
10 10 10 10 10
输出 #3
20
C++ 编辑器
输入
输出