s = input()
k = 0
ans = []
start = 0
for i in range(len(s)):
    if k == 0:
        ans.append(s[i])
        k += 1
        continue
    if ans[k - 1] != s[i]:
        ans.append(s[i])
        k += 1
    else:
        ans[k - 1] += s[i]
# print(ans)
print(k)
