counting the number of transitions for each day (day is kept fixed while