from collections import Counter

s = input()

counter = Counter(s)
si = s[0]
ans = 1

if len(counter.most_common()) == 1:
    print(ans)
else:
    for i in range(len(s)):
        if s[i] != si:
            ans += 1
            si = s[i]
        else:
            si = s[i:i + 2]
    print(ans)