def solution(babbling):
can = ["aya", "ye", "woo", "ma"]
answer = 0
# ans = []
for word in babbling:
# ans.append(word)
aword = ""
while True:
if len(word)>=2 and word[0:2] in can and aword != word[0:2]:
aword = word[0:2]
word = word[2:]
elif len(word)>=3 and word[0:3] in can and aword != word[0:3]:
aword = word[0:3]
word = word[3:]
else:
# ans = ans[:-1]
break
if len(word) == 0:
answer += 1
break
return answer