The bakery has made 300 total doughnuts / 10 doughnuts per box = <<300/10=30>>30 boxes of doughnuts.
So at the end of the day, they still have 30 total boxes of doughnuts – 27 sold boxes of doughnuts = <<30-27=3>>3 boxes of doughnuts leftover.
They are therefore giving away 3 boxes of doughnuts * 10 doughnuts per box = <<3*10=30>>30 doughnuts.
#### 30