
def myAnswer(S:list)->int:
   ans = 1
   pre = S.pop(0)
   i = 0
   while i < len(S):
      if(pre == S[i] and i !=len(S)-1):
         pre+=S[i+1]
         i+=1
      else:
         ans+=1
         pre = S[i]
         i+=1
   return ans


def modelAnswer():
   tmp=1
def main():
   S = list(input())
   print(myAnswer(S[:]))

if __name__ == '__main__':
   main()