def main():
  import itertools
  s=itertools.groupby(str(input()))
  
  ans=0 
  for k,v in s:
    l=len(list(v))
    if l<=2:
      ans+=1
    else:
      ans+=l//2+1
  
  print(ans)
  
if __name__=="__main__":
  main()