#
import sys
import math
import numpy as np
import itertools

# 文字列をリストに
s = list(input())

answer = 0
t = 0
u = 0
for i in range(len(s)):
    t = t*27 + (ord(s[i])-ord('a')+1)
    # different from -1
    print(i,s[i],answer,u,t)

    if t != u:
        u = t
        t = 0
        answer += 1
        
print(answer)
