Trial and error, friend.
They’re flightless, which helps. You basically tap the top of the container a few times to knock them all down, hold it over your tank, and open the lid. When the desired number of flies has scrambled up and fallen into the tank, you close it. Not hard at all.