#K77672. Beautiful String Transformation

    ID: 34917 Type: Default 1000ms 256MiB

Beautiful String Transformation

Beautiful String Transformation

Given a string s of length N, a string is defined as beautiful if no two consecutive characters are the same. Formally, a string s is beautiful if for all indices \( i \) with \( 1 \leq i < N \), we have \( s_i \neq s_{i+1} \). Your task is to compute the minimum number of operations required to transform the given string into a beautiful string. In one operation, you can change any character in the string to any other character.

Note: When a block of consecutive identical characters of length \( L \) occurs, the minimum number of operations needed is \( \lfloor L/2 \rfloor \), because you can change every second character in the block.

inputFormat

The input consists of two lines:

  1. The first line contains an integer N, the length of the string.
  2. The second line contains the string s of length N.

outputFormat

Output a single integer, which is the minimum number of operations required to transform the string into a beautiful string. The result should be printed to stdout.

## sample
4
aabb
2

</p>