# -*- coding: utf-8 -*-



s = eval(input())



i = 1

tmp = s[0]

cnt = 1

while i < len(s):

    if s[i] == tmp:

        if i == len(s) - 1:

            break

        tmp = s[i:i+2]

        i += 2

    else:

        tmp = s[i]

        i += 1



    cnt += 1



print(cnt)

s = eval(input())



prev = ""

lets = ""

ans = 0

for e in s:

    lets += e

    if lets != prev:

        ans += 1

        prev = lets

        lets = ""



print(ans)

# -*- coding: utf-8 -*-
s = eval(input())
i = 1
tmp = s[0]
cnt = 1
while i < len(s):
    if s[i] == tmp:
        if i == len(s) - 1:
            break
        tmp = s[i : i + 2]
        i += 2
    else:
        tmp = s[i]
        i += 1
    cnt += 1
print(cnt)

s = eval(input())
prev = ""
lets = ""
ans = 0
for e in s:
    lets += e
    if lets != prev:
        ans += 1
        prev = lets
        lets = ""
print(ans)

-# -*- coding: utf-8 -*- -i = 1 -tmp = s[0] -cnt = 1 -while i < len(s): -    if s[i] == tmp: -        if i == len(s) - 1: -            break -        tmp = s[i : i + 2] -        i += 2 -    else: -        tmp = s[i] -        i += 1 -    cnt += 1 -print(cnt) +prev = "" +lets = "" +ans = 0 +for e in s: +    lets += e +    if lets != prev: +        ans += 1 +        prev = lets +        lets = "" +print(ans)