program sample
	implicit none
    integer(8) :: x,y,count
    
    read(*,*) x,y
    
    if (x==1) then
    	count =count+300000
    else if (x==2) then
    	count = count+200000
    else if (x==3) then
    	count = count + 100000
    end if
    if (y==1) then
    	count =count+300000
    else if (y==2) then
    	count = count+200000
    else if (y==3) then
    	count = count + 100000
    end if
    if (x==1 .and. y==1) then
    	count = count + 400000
    end if

	write(*,*) count

	stop
end program sample