S = input()
N = len(S)
k = 0
pc = ""
i = 0
while i<N:
    c = S[i]
    i += 1
    if c==pc:
        if i==N:
            break
        while c==pc:
            c += S[i]
            i += 1
            if i==N:
                break
        else:
            k += 1
            pc = c
    else:
        k += 1
        pc = c
print(k)
