from collections import defaultdict
 
def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()
 
s = readChar()
b="-1"
ans=0
while len(s)>1:
  if b!=s[:1]:
    b=s[:1]
    s=s[1:]
    ans+=1
  else:
    b=s[:2]
    s=s[2:]
    ans+=1
if b!=s:
  ans+=1
 
print(ans)