You can also use stats functions num_entities

Best regards.