Count number of occurrence in a list with condition

Use Sorting predicates in PROLOG - #19 by brebs and adapt it to count.