While Loop -Example

Please explain how while loop is working.

I am confused, how we are getting 12,14,15 if are deducting -1 image