s = eval(input())

ansL = [s[0]]

ans = ""

for i in s[1:]:

    ans += i

    if ansL[-1] != ans:

        ansL.append(ans)

        ans = ""

print((len(ansL)))

s = eval(input())

a = b =  ""

ans = 0

for i in s:

    a += i

    if a != b:

        ans += 1

        a, b = "", a

print(ans)
s = eval(input())
ansL = [s[0]]
ans = ""
for i in s[1:]:
    ans += i
    if ansL[-1] != ans:
        ansL.append(ans)
        ans = ""
print((len(ansL)))

s = eval(input())
a = b = ""
ans = 0
for i in s:
    a += i
    if a != b:
        ans += 1
        a, b = "", a
print(ans)

-ansL = [s[0]] -ans = "" -for i in s[1:]: -    ans += i -    if ansL[-1] != ans: -        ansL.append(ans) -        ans = "" -print((len(ansL))) +a = b = "" +ans = 0 +for i in s: +    a += i +    if a != b: +        ans += 1 +        a, b = "", a +print(ans)