Counting the String

Problem


Return the number of times that the string "code" appears anywhere in the given string, except we'll accept any letter for the 'd', so "cope" and "cooe" count.

Example


solution('aaacodebbb') → 1

solution('codexxcode') → 2

solution('cozexxcope') → 2

Contributed by Erkan Ercan