In a similar scenario, instead of starting with 33 chocolate bars, the factory had only 17 bars initially. After giving away 6 samples and using 3 bars for quality control tests, how many chocolate bars remain in the factory?