Well, how many unfortunate one-legged citizens in town? 5% of 20,000, which is 5 x 20,000 / 100 = 100,000/100 = 1,000 of them.
And therefore there are 19,000 with two legs.
If half go barefoot then there would be 19,000/2 who wear two sandals and 1,000 who wear one sandal.
19,000/2 x 2 + 1000/2 x 1 = 19,000 + 500 = 19,500.
Is this right?