      program ans1
      implicit none
      integer :: X,Y
      integer :: XR,YR
      read(*,*) X,Y
      XR = 0
      YR = 0
      if(X == 1) XR = 300000
      if(X == 2) XR = 200000
      if(X == 3) XR = 100000
      if(Y == 1) YR = 300000
      if(Y == 2) YR = 200000
      if(Y == 3) YR = 100000
      if(X == 1 .and. Y == 1) XR = XR + 400000
      write(*,*) XR + YR
      end program ans1