def main():
    S = input()

    i = 0
    tmp = ""
    ans = 0
    while True:
        j = 1
        while True:
            if S[i:i+j] != tmp:
                tmp = S[i:i+j]
                i = i + j
                ans += 1
                break
            else:
                j += 1

            if i + j > len(S):
                break
            
        if i + j > len(S):
            break

    print(ans)

if __name__ == "__main__":
    main()