Below is an instruction that describes a task. Write a response that appropriately completes the request in Swahili. Please answer in Swahili.

### Instruction:
 Kununua kitabu, unalipa $20 kwa kila moja ya vitabu 5 vya kwanza dukani, na kwa kila kitabu kingine unachonunua zaidi ya $20, unapata punguzo la $2. Ikiwa Beatrice alinunua vitabu 20, alilipa kiasi gani dukani?


### Response:
 Kwa vitabu vya kwanza 5, Beatrice alilipa 5*$20 = $<<5*20=100>>100
Kwa kuwa gharama ya kila kitabu kingine inapungua kwa $2, gharama jumla ya vitabu vingine itakuwa $20-$2 = $18
Beatrice alinunua vitabu 20-5 = <<20-5=15>>15 vingine.
Gharama jumla ya vitabu vingine ni 15*$18 = $<<15*18=270>>270
Kwa vitabu vyote, Beatrice alilipa $100+$270 = $<<100+270=370>>370