Here's how I do it.
I load the bottom rack of my dishwasher with washed bottles. I don't need to count the bottles. Regardless of bottle size, as long as I get the rack as full as I can it always seems to work out to enough bottles for a 5 gallon batch. I then run it on a high temp cycle the night before I plan to bottle. This gives the bottles plenty of time to cool off. As long as you don't open the dishwasher in advance, everything inside is sterilized from the heat.
I then add the priming mix to my bucket, siphon my beer into the bucket, and place that bucket on the counter above the dishwasher. I sit on a small stool with my bottle wand and fill bottles. I'll pull them out of the dishwasher as I need them...this way there aren't a bunch of empty bottles to knock over/risk contamination.
My buddy (who is usually all buzzy from the brews) stands on the other side of the dishwasher and caps the bottles as I fill them.
This method works like a champ and any spillage is trapped on the dishwasher door for easy cleanup. I've also done both bottling and filling using this method. I'll bottle enough to fill the door up, cap those bottles, then fill another round.
hope this helps