Sarah has 18 oranges and 5 lemons. She gives 3 oranges to David, who in return gives her lemons. After the exchange, Sarah has twice as many oranges as lemons. How many lemons did David give to Sarah? Let's think step by step and output the final answer within \boxed{}.
user