Problem:


科目選択 (Selecting Subjects)

 問題

JOI 君は物理，化学，生物，地学，歴史，地理の 6 科目のテストを受けた．
それぞれのテストは 100 点満点で採点された．

JOI 君は物理，化学，生物，地学の 4 科目から 3 科目を選択し，歴史，地理の 2 科目から 1 科目を選択する．

テストの合計点が最も高くなるように科目を選ぶとき，
JOI 君の選んだ科目のテストの合計点を求めよ．

  入力

入力は 6 行からなり，1 行に 1 つずつ整数が書かれている．

1 行目には JOI 君の物理のテストの点数 A が書かれている．

2 行目には JOI 君の化学のテストの点数 B が書かれている．

3 行目には JOI 君の生物のテストの点数 C が書かれている．

4 行目には JOI 君の地学のテストの点数 D が書かれている．

5 行目には JOI 君の歴史のテストの点数 E が書かれている．

6 行目には JOI 君の地理のテストの点数 F が書かれている．

書かれている整数 A, B, C, D, E, F はすべて 0 以上 100 以下である．

  出力

JOI 君が選んだ科目のテストの合計点を 1 行で出力せよ．

 入出力例

入力例 1

  

100
34
76
42
10
0

 
出力例 1

   

228

入力例 2

  

15
21
15
42
15
62

 
出力例 2

  

140

入出力例 1 では，JOI 君が物理，生物，地学，歴史の 4 科目を選ぶとき，テストの合計点が最高になる．

物理，生物，地学，歴史の点数はそれぞれ 100, 76, 42, 10 なので，選んだ科目のテストの合計点は 228 である．  

入出力例 2 では，JOI 君が化学，生物，地学，地理の 4 科目を選ぶとき，テストの合計点が最高になる．

化学，生物，地学，地理の点数はそれぞれ 21, 15, 42, 62 なので，選んだ科目のテストの合計点は 140 である．

入出力例 2 では，JOI 君が物理，化学，地学，地理の 4 科目を選ぶ場合でも，選んだテストの合計点は 140 である．

情報オリンピック日本委員会作 『第 15 回日本情報オリンピック JOI 2015/2016 予選競技課題』



Sample input:
100
34
76
42
10
0


Sample output:
228

Submission status: Wrong Answer

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
F = int(input())

print(sum(sorted([A, B, C, D])[:3]) + max(E, F))

Submission status: Accepted

Solution code:
print(sum(sorted([int(input()) for _ in range(4)])[1:]) + max(int(input()), int(input())))

Submission status: Accepted

Solution code:
# coding: utf-8

science = [int(input()) for i in range(4)]
society = [int(input()) for i in range(2)]

score = 0
score += max(society)
score += sum(science) - min(science)
print(score)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())

e = max(e,f)
t = min(a,b)
t = min(c,t)
t = min(d,t)

print(a+b+c+d-t+e)

Submission status: Accepted

Solution code:
A = []
B = []
for i in range(4):
    A.append(int(input()))
for i in range(2):
    B.append(int(input()))

A.sort(reverse=True)
B.sort(reverse=True)
ans = sum(A[:3]) + B[0]
print(ans)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())
print(sum([a,b,c,d,max(e,f)])-min([a,b,c,d]))

Submission status: Accepted

Solution code:
a,b,c,d,e,f=[int(input()) for _ in range(6)]
print(sum([a,b,c,d,max(e,f)])-min([a,b,c,d]))

Submission status: Accepted

Solution code:
a = sorted([input() for _ in range(4)])
b = sorted([input() for _ in range(2)])

print sum(a[1:])+b[1]

Submission status: Accepted

Solution code:
print(sum(sorted(int(input()) for _ in range(4))[1:])+max([int(input()) for _ in range(2)]))

Submission status: Accepted

Solution code:
print(sum(sorted(int(input()) for _ in range(4))[1:])+max(int(input()) for _ in range(2)))

Submission status: Accepted

Solution code:
score= [int(input()) for _ in range(6)]
print(sum(sorted(score[:4], reverse=True)[:3])+max(score[4], score[5]))

Submission status: Accepted

Solution code:
array = [int(input()) for i in range(4)]
R = int(input())
T = int(input())
array.sort()
count = 0
count += array[-1]
count += array[-2]
count += array[-3]
if R>T:
    count +=R
    print(count)
else:
    count +=T
    print(count)

Submission status: Accepted

Solution code:
score=[]
min=100
total=0

for i in range(4):
    score.append(int(input()))
    if min>score[i]:
        min = score[i]
    total+=score[i]
total-=min
min=100
for i in range(4,6):
    score.append(int(input()))
    if min>score[i]:
        min=score[i]
    total+=score[i]
total-=min
print(str(total))

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())
x = a + b + c + d + e + f
y = 100000
for i in (a,b,c,d):
    if y > i : y = i
z = 0
if e < f : z = e
else : z = f
print (x - y - z)

Submission status: Accepted

Solution code:
sum  = 0
min1 = 101
min2 = 101
for i in range(4):
    n = int(input())
    sum += n
    if n < min1:
        min1 = n
for i in range(2):
    n = int(input())
    sum += n
    if n < min2:
        min2 = n
print(sum-min1-min2)

Submission status: Accepted

Solution code:
a=[int(input())for i in range(6)]
r=a[:4]
print(sum(r)-min(r)+max(a[4:]))

Submission status: Accepted

Solution code:
import sys

def main():
    score1 = []
    for i in range(4):
        score1.append(int(input()))
    score1.sort()
    score2 = []
    for i in range(2):
        score2.append(int(input()))
    score2.sort()

    print(sum(score1[1:]+score2[1:]))
    return 0

if __name__ == '__main__':
    sys.exit(main())

Submission status: Accepted

Solution code:
sc=sorted([int(input())for i in range(4)])
li=sorted([int(input())for i in range(2)])
print(sc[1]+sc[2]+sc[3]+li[1])

Submission status: Accepted

Solution code:
score = []
for i in range(6):
    score.append(int(input()))

sorted_score = sorted(score[:4])

sorted_score_2 = sorted(score[4:])

total = 0
for i in sorted_score[1:]:
    total += i
total += sorted_score_2[1]

print(total)

Submission status: Accepted

Solution code:
points_1 = []
points_2 = []
for _ in range(4):
    points_1.append(int(input()))

for _ in range(2):
    points_2.append(int(input()))

print(sum(sorted(points_1)[1:]) + max(points_2))

Submission status: Accepted

Solution code:
s = []
for i in range(4):
    s.append(int(input()))
l = []
for i in range(2):
    l.append(int(input()))
print(sum(s) - min(s) + max(l))

Submission status: Accepted

Solution code:
science, literature = [], []
for i in range(4):
    science.append(int(input()))
science = sorted(science, reverse=True)

for i in range(2):
    literature.append(int(input()))
literature = sorted(literature, reverse=True)

print(sum(science[:3]) + literature[0])

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
F = int(input())

print(sum(sorted([A, B, C, D], reverse=True)[:3]) + max(E, F))

Submission status: Accepted

Solution code:
# AOJ 0619: Selecting Subjects
# Python3 2018.7.2 bal4u

a = [int(input()) for i in range(6)]
print(sum(a[0:4])-min(a[0:4]) + max(a[4], a[5]))

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())

e = max(e,f)
t = min(a,b)
t = min(c,t)
t = min(d,t)

print(a+b+c+d-t+e)

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(6)]
print(sum(a[0:4])-min(a[0:4]) + max(a[4], a[5]))

Submission status: Accepted

Solution code:
a=[]
a=[int(input()) for _ in range(6)]
print(sum(a[0:4])-min(a[0:4])+max(a[4:6]))

Submission status: Accepted

Solution code:
a=[]
b=[]

for i in range (4):
    c=int(input())
    a.append(c)
    
for i in range (2):
    c=int(input())
    b.append(c)

print(sum(a)-min(a)+max(b))

Submission status: Accepted

Solution code:
a,b = [],[]

for i in range(4):
    a.append(int(input()))
    
for i in range(2):
    b.append(int(input()))
    
a.sort(reverse=True)
b.sort(reverse=True)

print(a[0]+a[1]+a[2]+b[0])

Submission status: Accepted

Solution code:
rika=[]
for i in range(4):
    tensu=int(input())
    rika.append(tensu)
    
syakai=[]
for i in range(2):
    tensu=int(input())
    syakai.append(tensu)
    
rika.sort()
syakai.sort()

goukei=sum(rika[1:])+syakai[1]
print(goukei)

Submission status: Accepted

Solution code:
a=[]
for i in range(6):
    a.append(int(input()))

s=min(a[0:4])
t=min(a[4:6])


a.remove(s)
a.remove(t)

print(sum(a))

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
F = int(input())
X = []
X.append(A)
X.append(B)
X.append(C)
X.append(D)
X.remove(min(X))
Y = []
Y.append(E)
Y.append(F)
Y.remove(min(Y))
Z = X + Y
W = sum(Z)
print(W)

Submission status: Accepted

Solution code:

x=[int(input()) for i in range(6)]

a=x[0:4]
b=sorted(a)
del b[0]

c=x[4:]
d=sorted(c)
del d[0]

y=b+d
print(sum(y))

Submission status: Accepted

Solution code:
n=[int(input()) for i in range(6)]
x=sum(n[0:4])-min(n[0:4])
y=max(n[4],n[5])
print(x+y)

Submission status: Accepted

Solution code:
A=[int(input()) for i in range(4)]
B=[int(input()) for r in range(2)]

C=int(sum(A)-min(A))
D=int(max(B))
print(C+D)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
print(a+b+c+d-min(a,b,c,d)+max(e,f))

Submission status: Accepted

Solution code:
list_a = []
list_b = []

for x in range(4) :
    list_a.append(int(input()))
list_a.sort(reverse = True)

for x in range(2) :
    list_b.append(int(input()))
list_b.sort(reverse = True)

print(sum(list_a[0:3]) + list_b[0])

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())
x = a + b + c + d + e + f
y = 100000
for i in (a,b,c,d):
    if y > i : y = i
z = 0
if e < f : z = e
else : z = f
print (x - y - z)

Submission status: Accepted

Solution code:
x=[int(input()) for i in range(6)]

a=x[0:4]
b=sorted(a)
del b[0]

c=x[4:]
d=sorted(c)
del d[0]

y=b+d
print(sum(y))

Submission status: Accepted

Solution code:
a = []
for i in range(4):
    n = int(input())
    a.append(n)

b = []
for i in range(2):
    m = int(input())
    b. append(m)

print(sum(a)-min(a)+max(b))

Submission status: Accepted

Solution code:
a=[]
b=[]
for i in range(4):
  a.append(int(input()))
  a.sort()

for j in range(4,6):
  b.append(int(input()))
  
print(sum(a[1:4])+max(b))

Submission status: Accepted

Solution code:
import sys

def main():
    score1 = []
    for i in range(4):
        score1.append(int(input()))
    score1.sort()
    score2 = []
    for i in range(2):
        score2.append(int(input()))
    score2.sort()

    print(sum(score1[1:]+score2[1:]))
    return 0

if __name__ == '__main__':
    sys.exit(main())

Submission status: Accepted

Solution code:
a=[]
b=[]
for i in range(4):
    n=int(input())
    a.append(n)
for i in range (2):
    n=int(input())
    b.append(n)
print(sum(a)-min(a)+max(b))

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(4)]
b = [int(input()) for i in range(2)]

a.pop(a.index(min(a)))
print(int(sum(a) + max(b)))

Submission status: Accepted

Solution code:
A = []
B = []
S = 0
for i in range(4):
    a = int(input())
    A.append(a)
    A.sort(reverse=True)
for j in range(3):
    S = S+A[j]
for i in range(2):
    a = int(input())
    B.append(a)
    B.sort(reverse=True)
for j in range(1):
    S = S+B[j]
print(S)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())

x = a + b + c + d - min(a,b,c,d)
y = max(e,f)
print(x + y)

Submission status: Accepted

Solution code:
scra = []
scrb = []

for i in range(4):
  scr = int(input())
  scra.append(scr)

for i in range(2):
  scr = int(input())
  scrb.append(scr)

scra.sort()
scrb.sort()

total = sum(scra[1:]) +  scrb[1]
print(total)

Submission status: Accepted

Solution code:
#(44)科目選択
a=[]
for i in range(4):
    n=int(input())
    a.append(n)
a.sort(reverse=True)
b=[]
for j in range(2):
    m=int(input())
    b.append(m)
b.sort(reverse=True)
sum=0
for k in range(3):
    sum+=a[k]
print(sum+b[0])

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
F = int(input())

X = [A, B, C, D]
X.sort()
t = X[1] + X[2] + X[3] + max(E, F)
print(t)

Submission status: Accepted

Solution code:
s1=[int(input()) for _ in range(4)]
s2=[int(input()) for _ in range(2)]
s1.sort(reverse=True)
s2.sort(reverse=True)
ans=s1[0]+s1[1]+s1[2]+s2[0]
print(ans)

Submission status: Accepted

Solution code:
a = []
b = []
for i in range (4):
    a.append(int(input()))
for i in range (2):
    b.append(int(input()))
    
print(sum(a) + sum(b) - min(a) - min(b))

Submission status: Accepted

Solution code:
alist = []
blist = []
for i in range(4):
    a = int(input())
    alist.append(a)
for i in range (2):
    b = int(input())
    blist.append(b)
alist.sort()
blist.sort()
print(alist[1]+alist[2]+alist[3]+blist[1])

Submission status: Accepted

Solution code:
a = []
b = []
for i in range (4):
    a.append(int(input()))
for i in range (2):
    b.append(int(input()))
print(sum(a)+sum(b)-min(a)-min(b))

Submission status: Accepted

Solution code:
list_a = []
list_b = []

for x in range(4):
    list_a.append(int(input()))
list_a.sort(reverse = True)

for x in range(2):
    list_b.append(int(input()))
list_b.sort(reverse = True)

print(sum(list_a[0:3]) + list_b[0])

Submission status: Accepted

Solution code:
x=[]
y=[]

for i in range(4):
    X = int(input())
    x.append(X)
    
for i in range (2):
    Y = int(input())
    y.append(Y)
    
list.sort(x)
    
list.sort(y)
    
print(x[1]+x[2]+x[3]+y[1])

Submission status: Accepted

Solution code:
list=[]
for i in range(4):
    a=int(input())
    list.append(a)
list.remove(min(list))

lst=[]
for i in range(2):
    a=int(input())
    lst.append(a)

print(sum(list)+max(lst))

Submission status: Accepted

Solution code:
a=[int(input()) for i in range(4)]
b=[int(input()) for i in range(2)]

a.sort()
b.sort()

print(sum(a[1:])+b[1])

Submission status: Accepted

Solution code:
rika=[]
for i in range(4):
    rika.append(int(input()))
a=min(rika)
rika.remove(a)
sum1=0
for i in range(3):
    sum1+=rika[i]
sya=[]
for i in range(2):
    sya.append(int(input()))
b=max(sya)
print(sum1+b)

Submission status: Accepted

Solution code:
q = [int(input()) for i in range(4)]
w = [int(input()) for i in range(2)]

q.pop(q.index(min(q)))
print(int(sum(q) + max(w)))

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(6)]
print(sum(a[0:4])-min(a[0:4]) + max(a[4], a[5]))

Submission status: Accepted

Solution code:
lst=[]
for i in range(6):
    n=int(input())
    lst.append(n)
a=lst[:4]
a.remove(min(a))
A=sum(a)
b=lst[4:]
b.remove(min(b))
B=sum(b)
print(A+B)

Submission status: Accepted

Solution code:
a,b,c,d,e,f=[int(input()) for i in range(6)]

list_1=[a,b,c,d]
list_2=[e,f]

list_1.remove(min(list_1))
list_2.remove(min(list_2))
print(sum(list_1)+sum(list_2))

Submission status: Accepted

Solution code:
num1=[]
num2=[]
for i in range(4):
    x=int(input())
    num1.append(x)
    
for i in range(2):
    y=int(input())
    num2.append(y)   
    
num1.sort()
num2.sort()

a=num1[1]
b=num1[2]
c=num1[3]
d=num2[1]
    

date=int(a+b+c+d)


print(date)

Submission status: Accepted

Solution code:
a = list()
b = list()

for i in range(4):
    a.append(int(input()))

a.sort()


for i in range(2):
    b.append(int(input()))

b.sort()

print(sum(a[1:]+b[1:]))

Submission status: Accepted

Solution code:
sub = []

for i in range(4):  
    a = int(input())
    sub.append(a)

list.sort(sub,reverse=True)
sum1 = sub[0]+sub[1]+sub[2]

b = int(input())
c = int(input())

print(sum1+max(b,c))

Submission status: Accepted

Solution code:
a=[int(input()) for i in range(6)]

s=sum(a[0:4])-min(a[0:4])+max(a[4],a[5])

print(s)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

a = []
a = [int(input()) for _ in range(6)]

print(sum(a[0:4])-min(a[0:4])+max(a[4:6]))

Submission status: Accepted

Solution code:
a=[]
b=[]

for i in range(4):
    a.append(int(input()))
for i in range(2):
    b.append(int(input()))

print(sum(a)-min(a)+max(b))

Submission status: Accepted

Solution code:
N=4
M=2
sum=0
I=[int(input()) for _ in range(N)]
I.sort()
sum=sum+I[3]+I[1]+I[2]
J=[int(input()) for _ in range(M)]
J.sort()
sum=sum+J[1]
print(sum)

Submission status: Accepted

Solution code:
a = []
for i in range(4):
  a.append(int(input()))
b = []
for j in range(2):
  b.append(int(input()))
print(sum(a)-min(a)+max(b))

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(4)]
b = [int(input()) for i in range(2)]

a.sort()
b.sort()

print(sum(a[1:])+b[1])

Submission status: Accepted

Solution code:
list=[int(input()) for j in range(6)]

x=[list[0],list[1],list[2],list[3]]
y=sorted(x)
sum=0
for i in range(1,4):
    sum+=int(y[i])
    
if list[4]>list[5]:
    sum+=int(list[4])
else:
    sum+=int(list[5])
print(sum)

Submission status: Accepted

Solution code:
min1,min2=100,100
sum1,sum2=0,0
for i in range(4):
    a=int(input())
    sum1+=a
    if a<min1:
        min1=a
sum1=sum1-min1
for j in range(2):
    b=int(input())
    sum2+=b
    if b<min2:
        min2=b
sum2=sum2-min2
print(sum1+sum2)

Submission status: Accepted

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
F=int(input())
print(A+B+C+D+E+F-min(A,B,C,D)-min(E,F))

Submission status: Accepted

Solution code:
list1=[]
list2=[]
for i in range(4):
    list1.append(int(input()))
list1.sort(reverse=True)
    
for i in range(2):
    list2.append(int(input()))
list2.sort(reverse=True)

print(sum(list1[0:3])+list2[0])

Submission status: Accepted

Solution code:
seiseki = []
for a in range(6):
  seiseki.append(int(input()))
print(sum(seiseki[0:4])-min(seiseki[0:4])+max(seiseki[4:6]))

Submission status: Accepted

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
F=int(input())

X=[]
X.append(A)
X.append(B)
X.append(C)
X.append(D)
X.remove(min(X))

Y=[]
Y.append(E)
Y.append(F)
Y.remove(min(Y))

Z=X+Y
W=sum(Z)
print(W)

Submission status: Accepted

Solution code:
lst1=[]
for i in range(4):
    a=int(input())
    lst1.append(a)
A=min(lst1)

lst2=[]
for j in range(2):
    b=int(input())
    lst2.append(b)
B=min(lst2)

X=sum(lst1)
Y=sum(lst2)
Z=X+Y-A-B
print(Z)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())

print(a+b+c+d-min(a,b,c,d)+max(e,f))

Submission status: Accepted

Solution code:
import heapq
list=[]
a=[int(input()) for i in range(6)]
b=a[:4]
c=a[4:6]
print(sum(heapq.nlargest(3,b)+heapq.nlargest(1,c)))

Submission status: Accepted

Solution code:
A=[]
B=[]
for i in range(4):
    a=int(input())
    A.append(a)
AA=sorted(A)
del AA[0]

for i in range(2):
    b=int(input())
    B.append(b)
BB=sorted(B)
del BB[0]

print(sum(AA)+sum(BB))

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(6)]
print(sum(a[0:4])-min(a[0:4]) + max(a[4], a[5]))

Submission status: Accepted

Solution code:
list=[]
for i in range(6):
    n=int(input())
    list.append(n)

list1=list[0:4]
list1.remove(min(list1))


list2=list[4:6]
list2.remove(min(list2))


a=sum(list1)+sum(list2)
print(a)

Submission status: Accepted

Solution code:
A,B=[],[]
for _ in range(4):
    A.append(int(input()))
for _ in range(2):
    B.append(int(input()))
A.sort(reverse=True)
B.sort(reverse=True)
print(A[0]+A[1]+A[2]+B[0])

Submission status: Accepted

Solution code:
a = []
b = []
for i in range (4):
    a.append(int(input()))
for i in range (2):
    b.append(int(input()))
print(sum(a)+sum(b)-min(a)-min(b))

Submission status: Accepted

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
F=int(input())

S=[]
S.append(A)
S.append(B)
S.append(C)
S.append(D)

S.remove(min(S))

T=[]
T.append(E)
T.append(F)

T.remove(min(T))

P=S+T

U=sum(P)
print(U)

Submission status: Accepted

Solution code:
a=[int(input()) for i in range(6)]
print(sum(a[0:4])-min(a[0:4])+sum(a[4:6])-min(a[4:6]))

Submission status: Accepted

Solution code:
lst=[]
for i in range(6):
    n=int(input())
    lst.append(n)

lst1=lst[0:4]
lst2=lst[4:6]
lst1.sort(reverse=True)
lst3=lst1[0:3]
a=sum(lst3)
b=max(lst2)

print(a+b)

Submission status: Accepted

Solution code:
print(sum(sorted(int(input()) for _ in range(4))[1:])+max(int(input()) for _ in range(2)))

Submission status: Accepted

Solution code:
l=[]
m=[]
for i in range(4):
    n=int(input())
    l.append(n)
    l.sort()
for k in range(4,6):
    a=int(input())
    m.append(a)
    m.sort()
l[0]=m[1]    
print(sum(l))

Submission status: Accepted

Solution code:
list1=[]

for i in range(6):
    n=int(input())
    list1.append(n)

list2=(list1[4:])  
list1=(list1[:4])

list1.sort()
del list1[0]
list2.sort()
del list2[0]

sum1=sum(list1)


sum2=sum(list2)
print(sum1+sum2)

Submission status: Accepted

Solution code:
list1=[]
list2=[]
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
list1.append(a)
list1.append(b)
list1.append(c)
list1.append(d)
list1.sort()
list1.reverse()
list2.append(e)
list2.append(f)
list2.sort()
list2.reverse()
print(list1[0]+list1[1]+list1[2]++list2[0])

Submission status: Accepted

Solution code:
import heapq

rika=[]
syakai=[]

for i in range(4):
    n=int(input())
    rika.append(n)
    
rika=heapq.nlargest(3,rika)

for j in range(2):
    n=int(input())
    syakai.append(n)
    
syakai=heapq.nlargest(1,syakai)

rika.extend(syakai)
print(sum(rika))

Submission status: Accepted

Solution code:
lstr=[int(input()) for i in range(4)]
lsts=[int(input()) for j in range(2)]

mr=max(lstr)
mr2=sorted(lstr)[-2]
mr3=sorted(lstr)[-3]
ms=max(lsts)
print(mr+mr2+mr3+ms)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
x = (a,b,c,d)
y = (e,f)
z = min(x)
w = sum(x)
z = w-z
g = z+max(y)
print(g)

Submission status: Accepted

Solution code:
x=[]
for i in range(4):
    a=int(input())
    x.append(a)
    
x.remove(min(x))
 
y=[]    
for j in range(2):
    a=int(input())
    y.append(a)
    
y.remove(min(y))

z=x+y

print(sum(z))

Submission status: Accepted

Solution code:
a=[]
for i in range(4):
    n=int(input())
    a.append(n)
a.sort(reverse=True)
b=[]
for i in range(2):
    m=int(input())
    b.append(m)
b.sort(reverse=True)
sum=0
for k in range(3):
    sum+=a[k]
print(sum+b[0])

Submission status: Accepted

Solution code:
alist = []
blist = []
for i in range(4):
    a = int(input())
    alist.append(a)
for i in range(2):
    b = int(input())
    blist.append(b)
s=sum(alist)-min(alist)+sum(blist)-min(blist)    
print(s)

Submission status: Accepted

Solution code:
x = []
y = []
for i in range(4):
    n = int(input())
    x.append(n)
    #x = sorted(x)
for i in range(2):
    n = int(input())
    y.append(n)
    #y = sorted(y)
print(sum(x)-min(x)+max(y))

Submission status: Accepted

Solution code:
a=[]
b=[]
for i in range(4):
    s=int(input())
    a.append(s)
for j in range(2):
    t=int(input())
    b.append(t)
a=sorted(a)
b=sorted(b)
print(sum(a[1:4])+b[1])

Submission status: Accepted

Solution code:
list1=[]
list2=[]
sum=0
for i in range(4):
    n1=int(input())
    list1.append(n1)
for j in range(2):
    n2=int(input())
    list2.append(n2)
list1.sort(reverse=True)
for x in range(3):
    sum+=list1[x]
list2.sort(reverse=True)
sum+=list2[0]
print(sum)

Submission status: Accepted

Solution code:
a = []
for i in range(6):
    n = int(input())
    a.append(n)
A = a[:4]
c = sorted(A, reverse=True)
x = c[0]
y = c[1]
z = c[2]
if a[4] > a[5]:
    w = a[4]
else:
    w = a[5]
print(x+y+z+w)

Submission status: Accepted

Solution code:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
F=int(input())
G=[A,B,C,D]
H=[E,F]
print(A+B+C+D+E+F-min(G)-min(H))

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
x=[a,b,c,d]
y=[e,f]
print(a+b+c+d+e+f-min(x)-min(y))

Submission status: Accepted

Solution code:
#(44)科目選択
a=[]
for i in range(4):
     n=int(input())
     a.append(n)
a.sort(reverse=True)
b=[]
for j in range(2):
     m=int(input())
     b.append(m)
b.sort(reverse=True)
sum=0
for k in range(3):
     u=a[(k)]
     sum+=u
B=b[0]
print(sum+B)

Submission status: Accepted

Solution code:
lis_1=[]
lis_2=[]
for i in range(4):
    a=int(input())
    lis_1.append(a)
lis_1.sort()
for i in range(4,6):
    a=int(input())
    lis_2.append(a)
lis_2.sort()
x=lis_1[-1]
y=lis_1[-2]
z=lis_1[-3]
s=lis_2[-1]
print(x+y+z+s)

Submission status: Accepted

Solution code:
x=[]
y=[]
for i in range(4):
    s=int(input())
    x.append(int(s))
a=min(x)
for i in range(2):
    s=int(input())
    y.append(int(s))
b=max(y)
total=sum(x)
print(total-a+b)

Submission status: Accepted

Solution code:
lst=[]
lt=[]
for i in range (4):
    n=int(input())
    lst.append(n)
lst.sort()
lst.pop(0)

    
for i in range (2):
    m=int(input())
    lt.append(m)
lt.sort()
lt.pop(0)

    
summ = sum(lst)+sum(lt)
print(f'{summ:.3g}')

Submission status: Accepted

Solution code:
phy=int(input())
che=int(input())
bio=int(input())
geo=int(input())
rek=int(input())
tir=int(input())

rika=[phy,che,bio,geo]
rika.sort()
a=rika[1]+rika[2]+rika[3]

if rek>tir:
    b=rek
else:
    b=tir
print(a+b)

Submission status: Accepted

Solution code:
lst=[]
lst2=[]
for i in range(4):
    a = int(input())
    lst.append(a)
lst.remove(min(lst))
for i in range(2):
    b = int(input())
    lst2.append(b)
lst2.remove(min(lst2))
lst.append(lst2[0])
print(sum(lst))

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(6)]
x = a[0:4]
y = a[4:6]
c = sum(a)-min(x)-min(y)    
print(c)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

a=[]
b=[]

for i in range(4):
  a.append(int(input()))
  a.sort(reverse=True)

for j in range(4,6):
  b.append(int(input()))
  b.sort(reverse=True)
  
print(sum(a[:3])+b[0])

Submission status: Accepted

Solution code:
a=[]
c=[]
for i in range(4):
    b=int(input())
    a.append(b)
A=sum(a)-min(a)
for i in range(2):
    d=int(input())
    c.append(d)
C=sum(c)-min(c)
print(A+C)

Submission status: Accepted

Solution code:
a=0
sum=0
list=[]
for i in range(0,6):
    n=int(input())
    list.append(n)
    
for i in range(0,3):
    if list[i]<list[i+1]:list[i],list[i+1]=list[i+1],list[i]
    sum=sum+list[i]

if list[4]<list[5]:sum=sum+list[5]
else:sum=sum+list[4]
print(sum)

Submission status: Accepted

Solution code:
a=[int(input()) for _ in range(4)]
b=[int(input()) for _ in range(2)]
a.sort()
b.sort()
sum = a[1] + a[2] + a[3] + b[1]
print(sum)

Submission status: Accepted

Solution code:
L = []
for i in range(4):
    a = int(input())
    L.append(a)
    N = sorted(L) #小さい順に並べる
A = (N[len(N) - 1]) + (N[len(N) - 2]) + (N[len(N) - 3]) #リストNの後ろから1番目＋2番目＋3番目

l = []
for i in range(2):
    b = int(input())
    l.append(b)
    M = sorted(l)
B = (M[len(M) - 1])

print( A + B )

Submission status: Accepted

Solution code:
list=[int(input()) for i in range(4)]
list.sort()
list.pop(0)
s=[int(input()) for i in range(2)]
s.sort()
s.pop(0)
t=list+s
print(sum(t))

Submission status: Accepted

Solution code:
lst = []

for i in range(6):
    r = int(input())
    lst.append(r)
    

for i in range(4):
    for j in range(3,i,-1):
        if lst[j] < lst[j-1]:
            lst[j],lst[j-1] = lst[j-1],lst[j]
    

R = lst[1]+lst[2]+lst[3]

if lst[4] > lst[5]:
    S = lst[4]
else:
    S = lst[5]

print(R+S)

Submission status: Accepted

Solution code:
list1 = [int(input()) for i in range(4)]

list2 = [int(input()) for i in range(2)]

list1_min = min(list1)

list2_min = min(list2)

print(sum(list1) + sum(list2) - list1_min - list2_min)

Submission status: Accepted

Solution code:
a,c=[],0
for i in range(4):
    a.append(int(input()))
a=sorted(a)
a.pop(0)
for j in range(2):
    b=int(input())
    if b>c:
        c=b
print(sum(a)+c)

Submission status: Accepted

Solution code:
a=[]
for i in range(4):
    x=int(input())
    a.append(x)
a.sort()
a.pop(0)
b=[]
for j in range(2):
    y=int(input())
    b.append(y)
b.sort()
b.pop(0)
print(sum(a)+sum(b))

Submission status: Accepted

Solution code:
i = [int(input()) for i in range(4)]
j = [int(input()) for j in range(2)]
print(sum(i)-min(i)+max(j))

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(6)]
m=sum(a[0:4])-min(a[0:4])
n=sum(a[4:6])-min(a[4:6])
print(m+n)

Submission status: Accepted

Solution code:
x=[]
rikei=0
bunkei=0
for i in range(6):
    n=int(input())
    x.append(n)

y=x[0:4]
y.remove(min(y))
for j in range(3):
    rikei+=y[j]
#print(rikei)
    
    
z=x[4:6]
z.remove(min(z))
for k in range(1):
    bunkei+=z[k]
#print(bunkei)
 
    
print(rikei+bunkei)

Submission status: Accepted

Solution code:
tensu=[None]*4
ten=[None]*2
for i in range(4):
    tensu[i]=input()
tensu=list(map(int,tensu))

for i in range(2):
    ten[i]=input()
ten=list(map(int,ten))

if ten[0]<ten[1]:
    b=0
    b=ten[0]
    ten[0]=ten[1]
    ten[1]=b

for i in range(4):
    if tensu[3]>tensu[i]:
        k=0
        k=tensu[i]
        tensu[i]=tensu[3]
        tensu[3]=k
    i+=1
    
s=0
i=0
for i in range(3):
    s+=tensu[i]
    i+=1

c=s+ten[0]

print(c)

Submission status: Accepted

Solution code:
A, B = [], []
for _ in range(4):
	A.append(int(input()))
for _ in range(2):
	B.append(int(input()))
A.sort(reverse=True)
B.sort(reverse=True)
print(A[0] + A[1] + A[2] + B[0])

Submission status: Accepted

Solution code:
A=[]
B=[]
for i in range(4):
    s1=int(input())
    A.append(s1)
for j in range(2):
    s2=int(input())
    B.append(s2)
C=sorted(A)
D=sorted(B)
C.pop(0)
D.pop(0)
sm1=sum(C)
sm2=sum(D)
print(sm1+sm2)

Submission status: Accepted

Solution code:
a=[int(input()) for i in range(6)]
print(sum(a[0:4])-min(a[0:4])+max(a[4],a[5]))

Submission status: Accepted

Solution code:
a=[int(input()) for i in range(6)]
print(sum(a[0:4])-min(a[0:4]) + max(a[4], a[5]))

Submission status: Accepted

Solution code:
r = []
s = []
t = 0
for i in range(1,7):
    if i <= 4:
        a = int(input())
        r.append(a)
    else:
        b = int(input())
        s.append(b)
l = min(r)
L = min(s)
r.remove(l)
s.remove(L)
for j in range(3):
    t += r[j]
t += s[0]
print(t)

Submission status: Accepted

Solution code:
tensu1=[]
tensu2=[]
i=0
while i<4:
    s=int(input())
    tensu1.append(s)
    i+=1
tensu1.sort()
while 4<=i and i<6:
    s=int(input())
    tensu2.append(s)
    i+=1
tensu2.sort()
sum1=0
for i in range(1,4):
    sum1+=tensu1[i]
sum2=tensu2[1]
print(sum1+sum2)

Submission status: Accepted

Solution code:
data = [int(input()) for z in range(6)]
data[:4]
a = min(data[:4])
b = sum(data[:4])

data[4:]
c = max(data[4:])

print(b - a + c)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())

min1 = 100
if min1 > a:    min1 = a
if min1 > b:    min1 = b
if min1 > c:    min1 = c
if min1 > d:    min1 = d

if e < f:   min2 = e
else:       min2 = f

print((a+b+c+d+e+f) - min1 - min2)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())

m=[a, b, c, d]
n=[e, f]

k=sorted(m, reverse=True)
l=sorted(n, reverse=True)

x=k[:3]
y=l[:1]

print(sum(x)+sum(y))

Submission status: Accepted

Solution code:
a = []
b = []
for i in range (4):
    n = int(input())
    a.append(n)
for j in range (2):
    m = int(input())
    b.append(m)
a.sort()
b.sort()    
y=int(a[1]+a[2]+a[3]+b[1])
print(y)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
f = int(input())

n = [a,b,c,d,e,f]

print(sum(n[0:4])-min(n[0:4]) + max(n[4], n[5]))

Submission status: Accepted

Solution code:
import math
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
F = int(input())
s = [A,B,C,D]
m = [E,F]
S=sorted(s, reverse=True)
M=sorted(m, reverse=True)
z = [S[0],S[1],S[2],M[0]]
print(math.floor(sum(z)))

Submission status: Accepted

Solution code:
lst=[]
for i in range(4):
    n=int(input())
    lst.append(n)
lst.remove(min(lst))

lst2=[]
for i in range(2):
    n=int(input())
    lst2.append(n)

print(sum(lst)+max(lst2))

Submission status: Accepted

Solution code:
# coding: utf-8
# 44

A = [int(input()) for i in range(4)]
B = [int(input()) for i in range(2)]

A.sort()
A.pop(0)

B.sort()
B.pop(0)

print(sum(A)+sum(B))