s = input() print(s .count('cat')+s .count('dog'))