s = eval(input())

ans = 0

t = p = ''



for i in range(len(s)):

  t += s[i]

  if t == p:

    continue

  p = t

  t = ''

  ans += 1



print(ans)
def solve():

  s = eval(input())

  ans = 0

  t = p = ''



  for i in range(len(s)):

    t += s[i]

    if t == p:

      continue

    p = t

    t = ''

    ans += 1



  print(ans)





solve()
s = eval(input())
ans = 0
t = p = ""
for i in range(len(s)):
    t += s[i]
    if t == p:
        continue
    p = t
    t = ""
    ans += 1
print(ans)

def solve():
    s = eval(input())
    ans = 0
    t = p = ""
    for i in range(len(s)):
        t += s[i]
        if t == p:
            continue
        p = t
        t = ""
        ans += 1
    print(ans)


solve()

-s = eval(input()) -ans = 0 -t = p = "" -for i in range(len(s)): -    t += s[i] -    if t == p: -        continue -    p = t -    t = "" -    ans += 1 -print(ans) +def solve(): +    s = eval(input()) +    ans = 0 +    t = p = "" +    for i in range(len(s)): +        t += s[i] +        if t == p: +            continue +        p = t +        t = "" +        ans += 1 +    print(ans) + + +solve()