1703 交换位置


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

一个01串,我们可以对相邻两个字符实行交换位置的操作. 求最少的操作次数使得所有的1的位置连续. eg. s="010110",swap(s[1],s[2])之后,变成"001110". 所以答案是1.

Input

多组数据,每组数据一个01字符串.串长不超过10^5

Output

首先输出Case #k: ,然后是答案.

Sample

Input

010110
10101100
000

Output

Case #1: 1
Case #2: 3
Case #3: 0

Source: dd


Comments

There are no comments at the moment.