#ABCのCに相当する問題
S = input()
s = list(S)
num = 1

for i in range(0, len(s)-1):
    if s[i] != s[i+1]:
        num += 1
    else:
        s[i] = s[i]+s[i+1]
        i+=1
    # if i == len(s)-1: break

num+=1

print(num)