Since all the ants travel at the same speed, let's say that they travel one inch per tick, where a tick is the amount of time it takes an ant to travel one inch. I'd like to introduce a series of characters I will call "Alfie, the absolutely amazing acrobatic flea"i, or just Ai for short. Each Alfie is riding on the back of ant. Each ant on markers 1 through 6 has an Alfie, and when these ants begin to march, each carries an Alfie with them towards 12. Because Alfie is an absolutely amazing acrobatic flea, whenever a collision occurs, he leaps from the ant he is riding to the oncoming ant, which will reverse direction, and so continue to carry him towards 12.
This is the crucial insight: Alfie will travel at 1 inch/tick, jumping from ant to ant, until the ant he is riding on falls off the end.
Let's start the clock at zero. Al6 starts at the 6 inch mark and travels 6 inches at the rate of 1 inch/tick until he rides an ant through inch marker 12 and off the end at time 6. Where has that ant been? Who cares? It's been traveling at a rate of 1 inch/tick for 6 ticks, so it has traveled 6 inches.
A5 starts at the 5 inch mark and travels for 7 ticks until he falls off the end. The ant that falls off the end with him has been traveling at a rate of 1 inch/tick for 7 ticks, so it has traveled 7 inches.
And so it continues. 6 ants fall off the right side of the ruler, at times (6, 7, 8, 9, 10, 11). Adding the distances up gives you 51 inches.
And we do the same on the right hand side. "Barbara, the beautiful but belligerent bouncing flea"i or Bi for short travels by riding ants going to the left, jumping from ant to ant until she falls off the end.
B7 travels 7 inches before falling off the 0 mark of the ruler at time 7, riding an ant that has traversed 7 inches, having been walking for 7 ticks. B8 is travels 8 inches, and so on.
6 ants fall off the left hand side of the ruler, having traveled for (7, 8, 9, 10, 11, 12) ticks, and hence the same number of inches. Adding up these distances give 57 inches.
In total, all ants travel 57+51 = 108 inches.
I hope that makes sense.