The model extends ManyEvents. Additionally, a single when clause monitors the changes of the entire e vector, and increases the value of v by one each time any when clause is triggered.
Summing up, the model contains N zero-crossing functions, generates M-1 state events if the simulation lasts 1 second, and contain a when clause triggered by N Boolean conditions.