remove unused occurrences after max_date or max_count