AtCoder Beginner Contest 124
翻译中…
Problem Statement
翻译中…
$N$ tiles are arranged in a row from left to right. The initial color of each tile is represented by a string $S$ of length $N$.
翻译中…
The $i$-th tile from the left is painted black if the $i$-th character of $S$ is 0, and painted white if that character is 1.
翻译中…
You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.
翻译中…
At least how many tiles need to be repainted to satisfy the condition?
翻译中…
Constraints
翻译中…
$1 \leq |S| \leq 10^5$$S_i$is0or1.
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
S
翻译中…
Output
翻译中…
Print the minimum number of tiles that need to be repainted to satisfy the condition.
翻译中…
样例
Input #1
000
Output #1
1
The condition can be satisfied by repainting the middle tile white.
Input #2
10010010
Output #2
3
Input #3
0
Output #3
0
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。