MapReduce for events number by type