s=eval(input())

l=len(s)

a=0

b=""

i=0

while i<l:

  if s[i]!=b:a+=1;b=s[i]

  else:b="";i+=1;a+=1

  i+=1

  if i==l+1:a-=1

print(a)
s=eval(input())+"--"

n=len(s)-1

ans=0

i=0

a=""

while i<n:

  if s[i]==a:

    i+=1

    a=""

  else:

    a=s[i]

  i+=1

  ans+=1

print((ans-1))
s = eval(input())
l = len(s)
a = 0
b = ""
i = 0
while i < l:
    if s[i] != b:
        a += 1
        b = s[i]
    else:
        b = ""
        i += 1
        a += 1
    i += 1
    if i == l + 1:
        a -= 1
print(a)

s = eval(input()) + "--"
n = len(s) - 1
ans = 0
i = 0
a = ""
while i < n:
    if s[i] == a:
        i += 1
        a = ""
    else:
        a = s[i]
    i += 1
    ans += 1
print((ans - 1))

-s = eval(input()) -l = len(s) -a = 0 -b = "" +s = eval(input()) + "--" +n = len(s) - 1 +ans = 0 -while i < l: -    if s[i] != b: -        a += 1 -        b = s[i] +a = "" +while i < n: +    if s[i] == a: +        i += 1 +        a = "" -        b = "" -        i += 1 -        a += 1 +        a = s[i] -    if i == l + 1: -        a -= 1 -print(a) +    ans += 1 +print((ans - 1))