Sometimes when I'm counting laps, I spend an entire lap figuring out what lap that was. Was that lap 28? Lap 29? Lap 27? Lap 30? Lap 20? Crap.
Sometimes it helps me to think about something to do with that number. 1, this is my first lap, the only lap I've done so far. 30, that's 50% of the way, 30 laps done and 30 laps to go. 10... that's... uh... how much percentage would 10 be? It's not 20%, that'd be 12 laps.

Working out the math is one of my favorites. I repeat the number in my head at the other end of the pool as my feet hit the wall, then repeat the new number when I get back.
I figure if I'm doing enough laps, one or two is within the margin of error, but sometimes I check my watch to see if I'm about where I'd expect to be, too.
Doing intervals or mixing it up helps, too. "I'm going to do 6 50s with a 15 second rest, and 2 100s with a 30 second rest" - when you know you only have 6 or 2 or whatever to do, you count them better.
