import sys
from collections import deque
import copy
input = sys.stdin.readline

S = deque(list(input()))
pre = deque()
cnt = 0
l = deque()
while S:
    while S:
        l.appendleft(S.pop())
        if l != pre:
            pre = copy.deepcopy(l)
            cnt += 1
            l = deque()
            break

print(cnt,end='')