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

c=100000

b=200000

a=300000

X.sort()

ans=0

cnt=0

for i in X:

    if i==1:

        ans+=a

        cnt+=1

    elif i==2:

        ans+=b

    elif i==3:

        ans+=c

if cnt==2:

    ans += 400000

print(ans)
# coding: utf-8



x, y = list(map(int,input().split()))



l1 = [1,2,3]

l2 = [300000,200000,100000]



ans = 0

if x in l1:

    ans += l2[l1.index(x)]

    

if y in l1:

    ans += l2[l1.index(y)]



if x == 1 and y == 1:

    ans += 400000



print(ans)
X = list(map(int, input().split()))
c = 100000
b = 200000
a = 300000
X.sort()
ans = 0
cnt = 0
for i in X:
    if i == 1:
        ans += a
        cnt += 1
    elif i == 2:
        ans += b
    elif i == 3:
        ans += c
if cnt == 2:
    ans += 400000
print(ans)

# coding: utf-8
x, y = list(map(int, input().split()))
l1 = [1, 2, 3]
l2 = [300000, 200000, 100000]
ans = 0
if x in l1:
    ans += l2[l1.index(x)]
if y in l1:
    ans += l2[l1.index(y)]
if x == 1 and y == 1:
    ans += 400000
print(ans)

-X = list(map(int, input().split())) -c = 100000 -b = 200000 -a = 300000 -X.sort() +# coding: utf-8 +x, y = list(map(int, input().split())) +l1 = [1, 2, 3] +l2 = [300000, 200000, 100000] -cnt = 0 -for i in X: -    if i == 1: -        ans += a -        cnt += 1 -    elif i == 2: -        ans += b -    elif i == 3: -        ans += c -if cnt == 2: +if x in l1: +    ans += l2[l1.index(x)] +if y in l1: +    ans += l2[l1.index(y)] +if x == 1 and y == 1: