word=""
word=input()
alphabet= ["dz=", "c=", "c-", "lj", "d-", "nj", "s=", "z="]
start, count = 0, 0,
while 1:
    for i in alphabet:
        if word[start:].find(i)>=0:
            count += 1
            if i == "dz=":
                start += 3
                continue
            start += 2
            continue
    else:
        break
print(count+(len(word)-start))