Solve the programming task below in a Python markdown code block.
There's a **"3 for 2"** (or **"2+1"** if you like) offer on mangoes. For a given quantity and price (per mango), calculate the total cost of the mangoes.

### Examples
```python
mango(3, 3) ==> 6    # 2 mangoes for 3 = 6; +1 mango for free
mango(9, 5) ==> 30   # 6 mangoes for 5 = 30; +3 mangoes for free
```
Also feel free to reuse/extend the following starter code:
```python
def mango(quantity, price):
```