s = input()
n = len(s)

str = list(s)

count = 0

if n == 1:
    count += 1
elif str[n-1] != str[n-2]:
    count += 1
    for i in range(1,n):
        if len(str[i]) == 2:
               continue
        elif str[i] == str[i-1]:
            str[i+1] = str[i] + str[i+1]
            count += 1
        elif str[i] != str[i-1]:
            count += 1
else:
    count += 1
    for i in range(2,n):
        if len(str[i]) == 2:
               continue
        elif str[i] == str[i-1]:
            str[i+1] = str[i] + str[i+1]
            count += 1
        elif str[i] != str[i-1]:
            count += 1
            


print(count)