#その前のstrと違って、けど一番短いのを足していけばいいだけ。
S = input()
L = [alphabet for alphabet in S]
moji1 = L[0]
moji2 = ''
i = 1
res = 0
while i < len(L):
  if moji1 == moji2:
    moji2 += L[i]
    i+=1
  else:
    res += 1
    moji1 = moji2
    moji2 = L[i]
    i += 1
print(res)