s = raw_input()

n = len(s)
K = 0
s_i1=""
size=1

#while len(s.strip(s[0]))>0 or len(s)>2:
while len(s)>2:
    s_i=s[0:size]

    if s_i1 == s_i:
        size = size + 1
    else:
        s_i1=s_i
        s = s[size:]
        size = 1
        K = K + 1
if not s_i1==s[0]:
    if len(s.strip(s[0]))>0:
        K=K+1
K=K+1
print K
