inp = input()

l = 0
forforw = None
forw = ''
for i in inp:

    if i == '=':
        if forw in ('c', 's'):
            pass

        elif forw == 'z':
            if forwforw == 'd':
                l -= 1
            else:
                pass
        else:
            pass
    elif i == '-':
        if forw in ('c', 'd'):
            pass
    elif i == 'j':
        if forw == 'n' or forw == 'l':
            pass
        else:
            l += 1
    else:
        l += 1

    forwforw = forw
    forw = i

print(l)
