s = str(eval(input()))

l = len(s)



counter = 0

prev = None

pivot = 0



while pivot < l:

    n = 1

    if prev == s[pivot]:

        if pivot + 1 < l:

            if pivot + 2 < l:

                prev = s[pivot + 2]

                counter += 2

                pivot += 3

            else:

                counter += 1

                break

        else:

            break

    else:

        counter += 1

        prev = s[pivot]

        pivot += n



print((int(counter)))
s = str(eval(input()))

cur = ""

prev = ""

counter = 0



for i in range(len(s)):

    cur += s[i]

    if cur != prev:

        counter += 1

        prev = cur

        cur = ""

print((int(counter)))
s = str(eval(input()))
l = len(s)
counter = 0
prev = None
pivot = 0
while pivot < l:
    n = 1
    if prev == s[pivot]:
        if pivot + 1 < l:
            if pivot + 2 < l:
                prev = s[pivot + 2]
                counter += 2
                pivot += 3
            else:
                counter += 1
                break
        else:
            break
    else:
        counter += 1
        prev = s[pivot]
        pivot += n
print((int(counter)))

s = str(eval(input()))
cur = ""
prev = ""
counter = 0
for i in range(len(s)):
    cur += s[i]
    if cur != prev:
        counter += 1
        prev = cur
        cur = ""
print((int(counter)))

-l = len(s) +cur = "" +prev = "" -prev = None -pivot = 0 -while pivot < l: -    n = 1 -    if prev == s[pivot]: -        if pivot + 1 < l: -            if pivot + 2 < l: -                prev = s[pivot + 2] -                counter += 2 -                pivot += 3 -            else: -                counter += 1 -                break -        else: -            break -    else: +for i in range(len(s)): +    cur += s[i] +    if cur != prev: -        prev = s[pivot] -        pivot += n +        prev = cur +        cur = ""