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

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

while index < len(S):
    if before == S[index]:
        index += 2
        before = "_"
    else:
        before = S[index]
        index += 1

    c += 1

print(c)