提示: 欢迎访问OurACM平台。
Problem 1994 Merry Christmas

Accept: 103    Submit: 317
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

There are several test cases.

Each case contains a string of length N (1<=N<=10^4) on a single line.

You should process to the EOF.

Input

There are several test cases.

In the first line there is only one integer T indicates the number of cases. (T <= 10000)

Each case contains a string of length N (1<=N<=10^4) on a single line.

You should process to the EOF.

Output

For each test case, print “Case idx: “ first there idx is the number of the case star from 1, then an integer indicates that the number of lucky sequence “314” in the input string.

Sample Input

3 I love 3.14~. 3.1415926535897932384626433 Orz FuDaHeWu, JinRunHouRen.

Sample Output

Case 1: 1 Case 2: 5 Case 3: 0

Source

FOJ有奖月赛-2010年12月

Submit  Back  Status  Discuss