# 128 B

l = list(map(int, input().split()))
max = l[0]
sum = 0

for i in range(len(l)):
    sum += l[i]
    if l[i] > max:
        max = l[i]
    
print(sum - max) l = list(map(int, input().split())) l list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split max = l[0] max l[0] l 0 sum = 0 sum 0 for i in range(len(l)):
    sum += l[i]
    if l[i] > max:
        max = l[i]
     i range(len(l)) range len(l) len l sum += l[i] sum l[i] l i if l[i] > max:
        max = l[i]
     l[i] > max l[i] l i max max = l[i] max l[i] l i print(sum - max) print sum - max sum max max = l[i] l[i] max l = list(map(int, input().split())) list(map(int, input().split())) l max = l[0] l[0] max sum = 0 0 sum sum += l[i] l[i] sum
# 128 B

l = list(map(int, input().split()))
max = l[0]
sum = 0

for i in range(len(l)):
    sum += l[i]
    if l[i] > max:
        max = l[i]
    
print(sum - max)