program DDCC_Finals
  implicit none
  integer :: x, y, m = 0
  read(*,*) x, y
  x = min(x,4)
  y = min(y,4)
  m = (4-x+4-y)*100000
  if (x == 1 .and. y == 1) m = 1000000
  write(*,'(i0)') m
end program DDCC_Finals