s = eval(input())

n = len(s)

ans = 1

last = s[0]

i = 1

while i < n:

  if len(last) == 2:

    last = s[i]

    i += 1

  else:

    if s[i] != last:

      last = s[i]

      i += 1

    else:

      if i != n-1:

        last = s[i:i+2]

        i += 2

      else:

        break

  ans += 1

  #print(last,ans)

print(ans)
#15:00(2)

s = eval(input())

n = len(s)

dp = [-1,0,1]

for i in range(1,n):

  if s[i-1] != s[i]:

    dp.append(dp[-1]+1)

  else:

    dp.append(dp[-3]+2)

print((dp[-1]))
s = eval(input())
n = len(s)
ans = 1
last = s[0]
i = 1
while i < n:
    if len(last) == 2:
        last = s[i]
        i += 1
    else:
        if s[i] != last:
            last = s[i]
            i += 1
        else:
            if i != n - 1:
                last = s[i : i + 2]
                i += 2
            else:
                break
    ans += 1
    # print(last,ans)
print(ans)

# 15:00(2)
s = eval(input())
n = len(s)
dp = [-1, 0, 1]
for i in range(1, n):
    if s[i - 1] != s[i]:
        dp.append(dp[-1] + 1)
    else:
        dp.append(dp[-3] + 2)
print((dp[-1]))

+# 15:00(2) -ans = 1 -last = s[0] -i = 1 -while i < n: -    if len(last) == 2: -        last = s[i] -        i += 1 +dp = [-1, 0, 1] +for i in range(1, n): +    if s[i - 1] != s[i]: +        dp.append(dp[-1] + 1) -        if s[i] != last: -            last = s[i] -            i += 1 -        else: -            if i != n - 1: -                last = s[i : i + 2] -                i += 2 -            else: -                break -    ans += 1 -    # print(last,ans) -print(ans) +        dp.append(dp[-3] + 2) +print((dp[-1]))