program main
	implicit none
    integer::a,b
    read(*,*)a,b
    if(a==1 .and. b==1)then
    	write(*,*) 1000000
    else if(a+b==3)then
    	write(*,*) 500000
    else if(a+b==4)then
    	write(*,*) 400000
    else if (a==1 .or. b==1)then
    	write(*,*) 300000
    else if (a==2 .or. b==2)then
    	write(*,*) 200000
    else if (a==3 .or. b==3)then
    	write(*,*) 100000
    else
    	write(*,*) 0
    end if
    stop
end program main