s = list(input())
N = len(s)
k = []
n = 0
i = 0

while i < N:
    k.append(s[i])
    n += 1
    if i == 0:
        n += 0
    elif k[i] == k[i - 1]:
        k[i] = 0
        n -= 1
    i += 1

print(n)
