
S = list(input())
counter = 1
i = 0
n = len(S)
while((n-i-1)>0):
    tmp = S[n-i-1]
    if S[n-i-2] == tmp and (n-i-2)>0:
        if S[n-i-3] == tmp and (n-i-3)>0:
            i +=3
            counter +=2
        else:
            i += 2
            counter +=1
    else:
        i +=1
        counter += 1
print(counter)