from sys import stdin


def main():

    S = stdin.readline().rstrip()
    S_len = len(S)

    sum = 0
    s = S[0]
    x = 1

    while True:
        if len(s) == 1:
            if s == S[x]:
                s = s + S[x]
            else:
                sum += 1
                s = S[x]
        else:
            sum += 2
            x += 1
            s = S[x]
        x += 1

        if x >= S_len:
            sum += 1
            break

    print(sum)


if __name__ == "__main__":
    main()
