def main(s: str):
    ans = 1

    prev = s[0]
    for s in s[1:]:
        if s == prev:
            prev += s
        else:
            prev = s
            ans += 1

    if len(prev) == 2: ans += 1

    print(ans)


if __name__ == "__main__":
    s = input()

    main(s)
