s = eval(input())

t = ''

k = 0

prev = ''

for i in range(len(s)):

  t += s[i]

  if prev != t:

    k += 1

    prev = t

    t = ''

print(k)

def divide_string(s):

    result = []

    prev, t = '', ''

    for i in range(len(s)):

        t += s[i]

        if prev != t:

            result.append(t)

            prev, t = t, ''

    if t != '':

        if len(result) == 1 or len(result[-2]) == 1:

            result[-1] = result[-1] + t

        else:

            result[-2] = result[-2] + t

    return result





S = eval(input())



print((len(divide_string(S))))

s = eval(input())
t = ""
k = 0
prev = ""
for i in range(len(s)):
    t += s[i]
    if prev != t:
        k += 1
        prev = t
        t = ""
print(k)

def divide_string(s):
    result = []
    prev, t = "", ""
    for i in range(len(s)):
        t += s[i]
        if prev != t:
            result.append(t)
            prev, t = t, ""
    if t != "":
        if len(result) == 1 or len(result[-2]) == 1:
            result[-1] = result[-1] + t
        else:
            result[-2] = result[-2] + t
    return result


S = eval(input())
print((len(divide_string(S))))

-s = eval(input()) -t = "" -k = 0 -prev = "" -for i in range(len(s)): -    t += s[i] -    if prev != t: -        k += 1 -        prev = t -        t = "" -print(k) +def divide_string(s): +    result = [] +    prev, t = "", "" +    for i in range(len(s)): +        t += s[i] +        if prev != t: +            result.append(t) +            prev, t = t, "" +    if t != "": +        if len(result) == 1 or len(result[-2]) == 1: +            result[-1] = result[-1] + t +        else: +            result[-2] = result[-2] + t +    return result + + +S = eval(input()) +print((len(divide_string(S))))