Throw Sort

Problem description

Kasumi came to a grocery store and found out that a lineup of a popular product is quite parse. So, she decided to take an action so that every item is closely next to each other and no longer experiencing loneliness.

What is the minimum number of relocating operation to accomplish her mission? The lineup is provided as a NN-length string, where "1" indicates an item and "0" an empty slot.

Constraints

  • 3N2×1053\leq N\leq2\times10^{5}
  • There are at least two remaining products.

Input example 1

5
00101

Output example 1

1

Input example 2

10
0100110011

Output example 2

2

Input example 3

3
111

Output example 3

0

提出


Go (1.21)