str = input()
c = list(str)
s = []

c_now = ""
s_now = ""

cnt = 0

for i in range(len(c)):
    if s_now != c_now:
        s.append(c_now)
        s_now = c_now
        cnt = cnt + 1
        if i != len(c)-1:
            c_now = c[i+1]
    else:
        c_now += c[i]

print(cnt)
