Cknight and String
题号:NC232327
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

Cknight gets a string s of length N . The string s consists of only character "a" and character "b".

Cknight wants to make string s chaotic. That is to say, string s does not contain string "ab" as its substring.


Cknight can use several operations to achieve that.

In each operation, he can choose a position in sand replace the corresponding letter with character "a" or character "b".


He wants to know the minimal number of operations required.

输入描述:

One line containing string s.

输出描述:

Output the answer.
示例1

输入

复制
bbbaababa

输出

复制
2

说明

In sample 1, modifying letters at position 6 and 8 is an optimal solution (suppose the string is 1-indexed).
示例2

输入

复制
aabbbbb

输出

复制
2

说明

In sample 2, modifying letters at position 1 and 2 is an optimal solution.