How to count licenses in use