my \a=[Z-] words[1..*-2,2..*];say 1+max [Z-] grep({!$_||a[$_]!=a[$_-1]//Nil},0..+a)[1..*,*]