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: pre_input_line = input("")
  input_line = []
  for c in pre_input_line:
      input_line.append(c)
  input_line += ["END"]
  string_letters = ""
  string_list = []
  for i in range(len(input_line) - 1):
      if input_line[i] == input_line[i + 1]:
          string_letters += input_line[i]
      else:
          string_letters += input_line[i]
      string_list.append(string_letters)
      string_letters = ""
  string_list.append("")
  K = 0
  count = 0
  for n in range(len(string_list)):
      if len(string_list[n]) % 3 == 2:
          count += 1
          if count == 2:
              K += (len(string_list[n - 1]) + len(string_list[n])) // 6 * 4 + 3
              count = 0
      else:
          if count == 1:
              K += len(string_list[n - 1]) // 3 * 2 + 1
              count = 0
          if len(string_list[n]) % 3 == 0:
              K += len(string_list[n]) // 3 * 2
          else:
              K += len(string_list[n]) // 3 * 2 + 1
  if count == 1:
      K += len(string_list[-1]) // 3 * 2 + 1
  print(K)
  
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"}]