S = list(eval(input()))

N = len(S)

ret = 0

pre = ""

dpl = [0] * (N+1)

dpr = [0] * (N+1)

tmp = ""

for i in range(1,N+1):

    tmp += S[i-1]

    if tmp == pre:

        dpl[i] = dpl[i-1]

    else:

        pre, tmp = tmp, ""

        dpl[i] = dpl[i-1] + 1



print((dpl[N]))
S = list(eval(input()))

N = len(S)

ret = 0

pre = ""

tmp = ""

for i in range(1,N+1):

    tmp += S[i-1]

    if tmp != pre:

        pre, tmp = tmp, ""

        ret += 1



print(ret)

S = list(eval(input()))
N = len(S)
ret = 0
pre = ""
dpl = [0] * (N + 1)
dpr = [0] * (N + 1)
tmp = ""
for i in range(1, N + 1):
    tmp += S[i - 1]
    if tmp == pre:
        dpl[i] = dpl[i - 1]
    else:
        pre, tmp = tmp, ""
        dpl[i] = dpl[i - 1] + 1
print((dpl[N]))

S = list(eval(input()))
N = len(S)
ret = 0
pre = ""
tmp = ""
for i in range(1, N + 1):
    tmp += S[i - 1]
    if tmp != pre:
        pre, tmp = tmp, ""
        ret += 1
print(ret)

-dpl = [0] * (N + 1) -dpr = [0] * (N + 1) -    if tmp == pre: -        dpl[i] = dpl[i - 1] -    else: +    if tmp != pre: -        dpl[i] = dpl[i - 1] + 1 -print((dpl[N])) +        ret += 1 +print(ret)