I\'m trying to count the number of 5 or more years with average values under a specified threshold (measure < 0.5), but excluding if there are consecutive sequences of 3 or m