There are stage lights in a row, numbered through . All lights are initially off.
Pressing button toggles every light from through , inclusive: lights that were off turn on, and lights that were on turn off. You may press any button any number of times.
You are given the lighting pattern required for the opening scene. What is the minimum number of button presses needed to create it?
The first line contains .
The second line contains a binary string of length . Character is 1 if light should be on, or 0 if it should be off.
Print the minimum number of button presses.
In Sample 1, press button to obtain 11110, then button to obtain 00110.
In Sample 2, press button once.
| Sample Input 1 | Sample Output 1 |
|---|---|
5 00110 |
2 |
| Sample Input 2 | Sample Output 2 |
|---|---|
4 1111 |
1 |