from sys import stdin

def main():
    S = input()

    prev = ''
    ans = 1
    for i in range(1, len(S)):
        if prev != S[i]:
            ans += 1
            prev = S[i]
        else:
            prev += S[i]
    print(ans)

input = lambda: stdin.readline().rstrip()
main()
