      PROGRAM DDCCfinals
        implicit none
        integer :: x,y,rank,ans
        integer :: third,second,first
        
        third  = 100000
        second = 200000
        first  = 300000
        ans    = 0
        
        read*,x,y
        
        rank = x
        if( rank==3 ) ans = ans + third
        if( rank==2 ) ans = ans + second
        if( rank==1 ) ans = ans + first
        rank = y
        if( rank==3 ) ans = ans + third
        if( rank==2 ) ans = ans + second
        if( rank==1 ) ans = ans + first
        
        if( x==1 .and. y==1 ) ans = ans + 400000
        
        print*,ans
        
        
      END PROGRAM