How far away was that lightning?

When lightning strikes, it takes a while before you hear thunder. There is a simple way to figure out how far away that lightning was from you by using how long it takes to hear thunder.