compute number of enttries more cheaply