python count consecutive repeated values in list