output_description: Print the maximum positive integer K that satisfies the condition.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: s = input().rstrip()
  
  # start from 1
  idx = 0
  pata = []
  patb = []
  pata.append(s[idx])
  idx += 1
  while idx < len(s):
      pata.append(s[idx])
      idx += 1
      while len(pata) > 1 and pata[-2] == pata[-1]:
          if idx < len(s):
              pata[-1] += s[idx]
              idx += 1
          else:
              last = pata.pop()
              pata[-1] += last
  
  # start from 2
  idx = 0
  patb = []
  patb.append(s[idx : idx + 2])
  idx += 2
  while idx < len(s):
      patb.append(s[idx])
      idx += 1
      while len(patb) > 1 and patb[-2] == patb[-1]:
          if idx < len(s):
              patb[-1] += s[idx]
              idx += 1
          else:
              last = patb.pop()
              patb[-1] += last
  
  print(max(len(pata), len(patb)))
  
problem_description: Statement
  
  Given is a string S consisting of lowercase English letters. Find the maximum
  positive integer K that satisfies the following condition:
  
    * There exists a partition of S into K non-empty strings S=S_1S_2...S_K such that S_i \neq S_{i+1} (1 \leq i \leq K-1).
  
  Here S_1S_2...S_K represents the concatenation of S_1,S_2,...,S_K in this
  order.
samples: [{"input": "aabbaa", "output": "4\n    \n\nWe can, for example, divide S into four strings `aa`, `b`, `ba`, and `a`.\n\n* * *"}, {"input": "aaaccacabaababc", "output": "12"}]