S = list(input())

cnt = 1
L = [0]*len(S)
flag = False

for i in range(len(S)-1):
    if flag == True:
        L[i] ,L[i+1] = 1, 1
        flag = False
    elif S[i] != S[i+1]:
        if i+2 == len(S):
            L[i+1] = 1
        L[i] = 1
        cnt += 1
    elif S[i] == S[i+1]:
        flag = True


print(sum(L))