S = input()
dp = [-1, -1]*len(S)
l = len(S)
count = 1
ans = 1
for i in range(1, l):
    if S[i] != S[i-1]:
        ans += 1
        count = 1
    else:
        if count == 1:
            count += 1
            if i == l-1:
                ans += 1
        else:
            count = 1
            ans += 1

print(ans)
