working solution for license count