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 = str(input())
  n = len(s)
  dp = [[0, 0] for i in range(n + 1)]
  for i in range(n):
      for j in [1, 2]:
          for k in [1, 2]:
              if i + k <= n:
                  a = s[i - j : i]
                  b = s[i : i + k]
                  if a != b:
                      dp[i + k][k - 1] = max(dp[i + k][k - 1], dp[i][j - 1] + 1)
  print(max(dp[n]))
  
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"}]