import sys


def input():
    return sys.stdin.readline()[:-1]


def main():
    S = input()
    ans = 1
    tmp = S[0]

    for s in S[1:]:
        if tmp != s:
            ans += 1
            tmp = s
        else:
            tmp += s
    if len(tmp) > 1:
        ans += 1
    print(ans)


if __name__ == '__main__':
    main()
