k = input()

cnt = 0
idx = 0
now = k[0]
if len(k) == 1:
  cnt = 1
else:
  while idx < len(k):
    
    # 最後の一文字
    if idx == len(k)-1:
      cnt += len(now)
      break
    
    if now != k[idx+1]:
      cnt += 1
      now = k[idx+1]
    else:
      now += k[idx+1]
    
    idx +=1

print(cnt)


