def main():
    S = input()
    buf = S[0]
    num = 1
    N = len(S)
    for i in range(1, N):
        if buf != S[i]:
            num += 1
            buf = S[i]
        else:
            if i == N-1:
                num += 1
            buf = buf + S[i]
    print(num)
main()