S = input()
S_len = len(S)
count = 1
point = 0
if S_len > 1:
  for i in range(0,S_len-1):
    if S[i] == S [i+1]:
      count=count + 1
      point=1
    elif S[i] == S [i+1] == S[i + 2] and i < S_len:
      count=count + 1
    elif S[i] != S[i+1] and S[i] != S[i-1]:
      if i > 0:
        count=count + 1
print(count)

