Programs can be written to have  as many variables as you need, but you can solve this problem  with just one.
os programas podem conter quantas variáveis necessárias, mas você pode resolver esse problema com apenas uma.