S = eval(input())

lis = [S[0]]

i = 1

while i<len(S)-1:

  if S[i]==lis[-1]:

    lis.append(S[i:i+2])

    i += 2

  else:

    lis.append(S[i])

    i += 1

ans = len(lis)

if i==len(S)-1 and S[i]!=lis[-1]:

  ans += 1

print(ans)
def solve():

  S = eval(input())

  ans = 0

  now = ''

  i = 0

  while i<len(S)-1:

    if S[i]==now:

      now += S[i+1]

      i += 1

    else:

      now = S[i]

    i += 1

    ans += 1

  if i==len(S)-1 and now!=S[i]:

    ans += 1

  return ans

print((solve()))
S = eval(input())
lis = [S[0]]
i = 1
while i < len(S) - 1:
    if S[i] == lis[-1]:
        lis.append(S[i : i + 2])
        i += 2
    else:
        lis.append(S[i])
        i += 1
ans = len(lis)
if i == len(S) - 1 and S[i] != lis[-1]:
    ans += 1
print(ans)

def solve():
    S = eval(input())
    ans = 0
    now = ""
    i = 0
    while i < len(S) - 1:
        if S[i] == now:
            now += S[i + 1]
            i += 1
        else:
            now = S[i]
        i += 1
        ans += 1
    if i == len(S) - 1 and now != S[i]:
        ans += 1
    return ans


print((solve()))

-S = eval(input()) -lis = [S[0]] -i = 1 -while i < len(S) - 1: -    if S[i] == lis[-1]: -        lis.append(S[i : i + 2]) -        i += 2 -    else: -        lis.append(S[i]) +def solve(): +    S = eval(input()) +    ans = 0 +    now = "" +    i = 0 +    while i < len(S) - 1: +        if S[i] == now: +            now += S[i + 1] +            i += 1 +        else: +            now = S[i] -ans = len(lis) -if i == len(S) - 1 and S[i] != lis[-1]: -    ans += 1 -print(ans) +        ans += 1 +    if i == len(S) - 1 and now != S[i]: +        ans += 1 +    return ans + + +print((solve()))