I was looking back at some basic questions and I couldn't figure it out... I know the answer but not how it is done (back of the book)

Two bags of sweets each contain blackjacks and fruities

There are fewer than 50 sweets in Bag A

5% of the sweets are blackjack

Write down all possible values for the number of sweets in bag A

(2 marks)