S = list(input())
ansA = 0
ind = 0
flag = False
while ind < len(S)-1:
    if S[ind] != S[ind+1] or flag:
        ansA += 1
        ind += 1
        flag = False
    else:
        ansA += 1
        ind += 2
        flag = True

S = list(reversed(S))
ind = 0
ansB = 0
flag = False
while ind < len(S)-1:
    if S[ind] != S[ind+1] or flag:
        ansB += 1
        ind += 1
        flag = False
    else:
        ansB += 1
        ind += 2
        flag = True

print(min(ansA,ansB)+1)