S = input()
S_len = len(S)
count = 1

if S_len > 1:
  for i in range(0,S_len-1):
    if S[i] != S [i+1]:
      count=count + 1
    if i > S_len - 4:
      if S[i:1+1] == S[i+2:i+3]:
        count=count+1

print(count)