# Dividing a String
S = str(input())
count = 0
i = 0
while i <= len(S)-1:
    if i == 0:

        count = count + 1
        i = i + 2
    elif i % 3 == 0:
        if i == len(S)-1 :
            break
        else:
            count = count + 1
            i = i + 2
    elif i < len(S) - 1:
        if S[i - 2] != S[i - 1] and S[i-1] != S[i]and S[i] != S[i + 1]:
            count = count + 2
            i = i + 1
        else:
            count = count + 1
            i = i + 1
    else:
        if S[i - 1] != S[i - 2] and S[i] != S[i - 1]:
            count = count + 1
            i = i + 1
        else:
            i = i + 1

count = count + 1
print(count)