At Fito's garden, $N$ tiles are arranged in a row. 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$.
Fito wants to repaint some of the tiles black or white so that any two adjacent tiles have different colors. What is the minimum amount of tiles that he need to repaint in order to satisfy this condition?
In the first example, Fito could repaint the second tile and the sequence would be $010$ (any two adjacent tiles have different colors). Therefore the minimum amount of tiles to repaint is $1$ since at least one has to be repainted because the original sequence does not satisfy the condition.