S = eval(input())

S0 = S[-1]

i = -1

j = 0

ans = 1



while i > -len(S) + 1:

    if S0 != S[i - (j + 1):i]:

        S0 = S[i - (j + 1):i]

        ans = ans + 1

        i = i - (1 + j)

        j = 0

    else:

        j = j + 1



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

    ans = ans + 1



print(ans)
S = list(eval(input()))



temp1 = S[0]

temp2 = ""

i = 1

c = 1

while i < len(S):

    temp2 += S[i]

    if temp1 != temp2:

        c += 1

        temp1 = temp2

        temp2 = ""

    i += 1



print(c)

S = eval(input())
S0 = S[-1]
i = -1
j = 0
ans = 1
while i > -len(S) + 1:
    if S0 != S[i - (j + 1) : i]:
        S0 = S[i - (j + 1) : i]
        ans = ans + 1
        i = i - (1 + j)
        j = 0
    else:
        j = j + 1
if i == -len(S) + 1 and S[-len(S)] != S0:
    ans = ans + 1
print(ans)

S = list(eval(input()))
temp1 = S[0]
temp2 = ""
i = 1
c = 1
while i < len(S):
    temp2 += S[i]
    if temp1 != temp2:
        c += 1
        temp1 = temp2
        temp2 = ""
    i += 1
print(c)

-S = eval(input()) -S0 = S[-1] -i = -1 -j = 0 -ans = 1 -while i > -len(S) + 1: -    if S0 != S[i - (j + 1) : i]: -        S0 = S[i - (j + 1) : i] -        ans = ans + 1 -        i = i - (1 + j) -        j = 0 -    else: -        j = j + 1 -if i == -len(S) + 1 and S[-len(S)] != S0: -    ans = ans + 1 -print(ans) +S = list(eval(input())) +temp1 = S[0] +temp2 = "" +i = 1 +c = 1 +while i < len(S): +    temp2 += S[i] +    if temp1 != temp2: +        c += 1 +        temp1 = temp2 +        temp2 = "" +    i += 1 +print(c)