program answer
implicit none

integer :: X, Y, sum

read(*,*) X, Y

if(X==1.and.Y==1) then
    write(*,*) '1000000'
     stop
end if

sum = 0
if(X==1.or.Y==1) then
   sum = sum + 300000
end if

if(X==2) then
 sum = sum + 200000
end if

if(Y==2) then
 sum = sum + 200000
end if

if(X==3) then
 sum = sum + 100000
end if

if(Y==3) then
sum = sum + 100000
end if

write(*,*)  sum

stop
end program answer