program prob1
    implicit none
    integer :: x, y
    read(*,*) x,y

    if(x == 1 .and. y == 1) then
        write(*,*) "1000000"
    else
        write(*,*) (max(4-x, 0)+max(4-y, 0))*100000
    end if


    stop
contains
end program prob1