How to prevent variable going below zero?

Printable View