Count the number of exits