program proba
	implicit none
	integer :: x, y
    integer :: ans
    
    read(*,*) x,y
    
    ans = 0
    if(x == 1 .and. y == 1) then
    	ans = 1000000
	else
    	ans = max(4-x, 0) * 100000 + max(4-y, 0) * 100000
    end if
    
    write(*,*) ans
    stop
end program proba