#!/usr/bin/env python3
import sys


def solve(S: str):
    ret = 0
    prev = "."

    pos = 0
    while pos < len(S):
        if prev == S[pos]:
            prev = S[pos:pos+2]
            pos += 2
            if pos < len(S) -1:
                ret += 1
        else:
            prev = S[pos]
            pos += 1
            ret += 1

    print(ret)

        



# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    S = sys.stdin.readline()
    solve(S.strip())

if __name__ == '__main__':
    main()
