
def solve():
    S = list(raw_input())
    prevSi = S[0]
    cnt = 1
    cur = 1
    while cur < len(S):
        if S[cur] != prevSi:
            prevSi = S[cur]
            cnt += 1
            cur += 1
        elif cur < len(S) - 1:
            prevSi = S[cur] + S[cur + 1]
            cnt += 1
            cur += 2
        else:
            prevSi += S[cur]
            cur += 1
    print cnt

if __name__ == '__main__':
    solve()
