If the doors are numbered in the conventional way—1 through 20—the cost is 122 Kwanzas (Kw).

We can save 2 Kw by starting the numbering at 0 instead of 1 because we get rid of the 20, which costs 12 Kw, and add the 0, which costs 10 Kw.

Bernard Montaron suggests that we try a different base. Base 2, using only 1s and 0s would be very expensive because of all the zeros at 10 Kw each, but using base 7 costs only 104 Kw.

It also turns out that base 8 numbering costs the same as using base 7, but base 6 or base 9 costs more.