Ratings counting

Counting functions for ratings.