import sys
from heapq import *
sys.setrecursionlimit(200000)
input = sys.stdin.readline

S = list(input().strip())
before = S[0]
index = 1
c = 0
a = ""

while index < len(S):
    a += before
    if before != S[index]:
        before = S[index]
        index += 1
    else:
        before = "".join(S[index:index+2])
        index += 2

    c += 1

if a != S:
    if S[-1] != S[-2]:
        c += 1
print(c)