s = input()
k = 0
past = ''
cont = 0
for i in range((len(s))):
    if i == len(s) - 1:
        if s[i] != s[i-1]:
            k += 1
            print(k)
            exit()
        else:
            print(k)
            exit()
    if cont == 0:
        if past != s[i] :
            past = s[i]
            k += 1
        else:
            past = s[i] + s[i+1]
            k += 1
            cont = 1
    else:
        cont = 0
print(k)