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.


-----Examples-----
Input
7 3 7 3 20

Output
26

Input
7 9 3 1 8

Output
28

Input
10 10 10 10 10

Output
20



-----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.

Difficulty: interview

Starter code:

Solutions:
cards = list(map(int, input().split()))

result = sum(cards)

for i in range(5):
    cnt = cards.count(cards[i])
    cnt = min(cnt, 3)
    if cnt not in [2, 3]:
        continue
    result = min(result, sum(cards) - cnt * cards[i])

print(result)


a = list(map(int, input().split()))
cnt = [0] * 1000
for i in a:
    cnt[i] += 1
s = sum(a)
res = s
for i in range(1000):
    cnt[i] = min(cnt[i], 3)
    if 2 <= cnt[i]:
        res = min(res, s - cnt[i] * i)
print(res)


def count(a, x):
    ans = 0
    for y in a:
        if x == y:
            ans += 1
    return ans

a = list(map(int, input().split()))
s = sum(a)
ans = s
for x in a:
    v = count(a, x)
    if 2 <= v:
        ans = min(ans, s - min(v, 3) * x)

print(ans)


import sys,math
z=list(map(int,input().split()))
s=sum(z)
min_=s
for i in range(len(z)):
    f=z.count(z[i])
    if f>=3:
        min_=min(min_, s-3*z[i])
    elif f==2:
        min_=min(min_, s-2*z[i])
print(min_)

l = list(map(int, input().split()))
orig = sum(l)
ans = sum(l)
for i in l:
    if l.count(i) == 2:
        ans = min(ans, orig-i*2)
    elif l.count(i) >= 3:
        ans = min(ans, orig-i*3)
print(ans)


l = list(map(int, input().split()))
mn = sum(l)
for i in range(1, 101):
	if l.count(i) >= 2:
		mn = min(mn, sum(l) - i * 2)
	if l.count(i) >= 3:
		mn = min(mn, sum(l) - i * 3)
print(mn)

from collections import Counter

t = Counter(list(map(int, input().split())))
s = ans = sum(x * t[x] for x in t)
for x in t:
    if t[x] > 1:
        ans = min(ans, s - x * min(3, t[x]))
print(ans)


read = lambda: list(map(int, input().split()))
t = sorted(read())
Sum = ans = sum(t)
a = set(t)
for i in a:
    if t.count(i) == 1: continue
    cur = Sum - min(3, t.count(i)) * i
    ans = min(ans, cur)
print(ans)


d = {}
l = list(map(int, input().split()))
s = sum(l)
for i in l:
    d[i] = d.get(i, 0) + 1
ans = s
for i in d:
    if 2 <= d[i]:
        ans = min(ans, s - i * min(3, d[i]))
print(ans)

cards = list(map(int, input().split()))

zmensenie = 0
for card in cards:
    oc = 0
    for c2 in cards:
        if c2 == card:
            oc += 1
    if oc >= 2:
        oc = min(oc, 3)
        zmensenie = max(zmensenie, oc * card)

print(sum(cards)-zmensenie)

from collections import Counter

a = Counter(map(int, input().split()))
s = sum(b * c for b, c in a.items())
res = s

for b, c in a.items():
	if c >= 2:
		res = min(res, s - 2 * b)
	if c >= 3:
		res = min(res, s - 3 * b)

print(res)

from collections import Counter


def solve():
    N = list(map(int, input().split()))
    S = sum(N)
    co = Counter(N)

    ans = S
    for n in co:
        if co[n] >= 3:
            ans = min(ans, S - n * 3)
        elif co[n] == 2:
            ans = min(ans, S - n * 2)

    print(ans)


def __starting_point():
    solve()

__starting_point()

a = list(map(int, input().split()))
b = [0]*150
ma = 0
for i in range(5):
    b[a[i]] += 1
    if b[a[i]] > 1:
        if b[a[i]]*a[i] > ma and b[a[i]] < 4:
            ma = b[a[i]]*a[i]
print(sum(a) - ma)

t = list(map(int, input().split()))
p = sum(t)
for i in range(5):
    if t.count(t[i]) >= 2:
        p = min(p, sum(t) - t[i] * 2)
for i in range(5):
    if t.count(t[i]) >= 3:
        p = min(p, sum(t) - t[i] * 3)
print(p)


t = list(map(int, input().split()))
s = sum(t)
ans = s
for i in range(5):
    c = t.count(t[i])
    if c >= 2:
       ans = min(s - min(c, 3) * t[i], ans)
print(ans)

arr = list(map(int, input().split()))
arr.sort()
ans = []
s = sum(arr)
if (len(set(arr)) == len(arr)):
	ans.append(sum(arr))
else:
	if (arr[-1]==arr[-2]==arr[-3]):
		ans.append(arr[0]+arr[1])
	if (arr[-4]==arr[-2]==arr[-3]):
		ans.append(arr[0]+arr[4])
	if (arr[-3]==arr[-4]==arr[-5]):
		ans.append(arr[3]+arr[4])
	for i in range(5):
		for j in range(i + 1, 5):
			if (arr[i] == arr[j]):
				ans.append(s - arr[i] - arr[j])
print(min(ans))

t = list(map(int, input().split()))
best = sum(t)
for x in t:
    if t.count(x) == 1: continue
    best = min(best, sum(t) - x * min(3, t.count(x)))
print(best)

m = list(map(int, input().split()))
m.sort(reverse=True)
count = 1
now = m[0]
sums = [0]
for i in range(1, 5):
    if m[i] == now:
        count += 1
    else:
        if count == 2:
            sums.append(2 * now)
        elif count > 2:
            sums.append(3 * now)
        now = m[i]
        count = 1
if count == 2:
    sums.append(2 * now)
elif count > 2:
    sums.append(3 * now)
ans = sum(m) - max(sums)
print(ans)

n = list(map(int, input().split()))
n.sort()
ans = 0
for i in range(len(n) - 1):
    if n[i] == n[i + 1]:
        ans = max(n[i] + n[i + 1], ans)

for i in range(len(n) - 2):
    if n[i] == n[i + 1] and n[i] == n[i + 2]:
        ans = max(n[i] + n[i + 1] + n[i + 2], ans)

print(sum(n) - ans)


a = list(map(int, input().split()))
s = {}
summa = 0
for i in a:
    summa += i
    try:
        s[i] += 1
    except KeyError:
        s[i] = 1
ans = summa
for i in s:
    if s[i] == 1:
        pass
    else:
        if s[i] == 2:
            ans = min(ans, summa - i * 2)
        else:
            ans = min(ans, summa - i * 3)
print(ans)

l=list(map(int,input().split()))
ans=t=sum(l)
for i in range(5):
  for j in range(i+1,5):
    if l[i]==l[j] and t-l[i]-l[j]<ans: ans=t-l[i]-l[j]
for i in range(5):
  for j in range(i+1,5):
    for k in range(j+1,5):
      if l[i]==l[j]==l[k] and t-l[i]-l[j]-l[k]<ans: ans=t-l[i]-l[j]-l[k]
print(ans)


import sys
from collections import Counter

arr = list(map(int, input().split()))

d = Counter(arr)

temp = [min(v, 3) * k for k, v in list(d.items()) if v >= 2]

print(sum(arr) - max(temp + [0, 0]))

sys.stdout.flush()


s = [int(j) for j in input().split()]
o = []
for i in range(5):
    if s[i] in s[i+1:]:
        o.append(s[i])
m = sum(s)
for i in o:
    y = 0
    t = 0
    for j in s:
        if j != i or t>2:
            y+=j
        if j == i:
            t+=1
    m = min(y,m)
print(m)
    



cartes=list(map(int,input().split()))
somme=sum(cartes)
nbOccurence=[0]*100
enleverMax=0
for carte in cartes:
	nbOccurence[carte-1]+=1

for numeroCarte,nombre in enumerate(nbOccurence):
	
	nombreEnlever=min(3,nombre)
	if nombre>=2 and (numeroCarte+1)*nombreEnlever>enleverMax:
		enleverMax=(numeroCarte+1)*nombreEnlever

print(somme-enleverMax)
		


t = [int(x) for x in input().split(' ')]

t.sort()
c = 0
for i in t:
	if t.count(i) == 1: c += 1
	
if c == 5:
	print(sum(t))
	return

c = 0

m = []

for i in t:
	if t.count(i) == 2: m.append(2*i)
	if t.count(i) == 3: m.append(3*i)
	if t.count(i) == 4: m.append(3*i)
	if t.count(i) == 5: m.append(3*i)
	
print(sum(t) - max(m))