s=input()

count=1
k=0

for i in range(len(s)-1):
    if s[i+k]==s[i+k+1]:
        k+=1
        count+=1
        if i+k>=len(s)-2:
            print(count)
            exit()
    else:
        count+=1
        if i+k>=len(s)-2:
            print(count)
            exit()
print(count)