Take a look a these examples:
What is the value of the digit in red? 2432 --> 30 2131 --> 30 1327 --> 300 2543 --> 3 3476 --> 3000