S = input()
N = len(S)
dp = [[0] * 2 for _ in range(N + 1)]

dp[0][1] = 1
dp[0][0] = 1
for i in range(N):
    s = S[i]
    if i != 0:
        if S[i-1] == s:
            dp[i+1][1] = dp[i][0] + 1
            dp[i+1][0] = dp[i][1]
        else:
            dp[i+1][1] = dp[i][1] + 1
            dp[i+1][0] = dp[i][0] + 1
    else:
        dp[i+1][1] = dp[i][0] + 1
print(min(dp[N][0], dp[N][1]))
