1352 String repair


Submit solution

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

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

Description

z_y recently invent a technique of repairing String that contains illegal segments. For the sake of simplicity, a String is only made up of lowercase. The repairing technique is simply to replace some characters with ‘A’ to eliminate all illegal segments. For example, we can repair a String "abvdhg" to "abAdhA" to eliminate the initial illegal segments "abv" and "hg" by changing two characters. You are to help z_y to repair a String by changing least number of characters.

Input

The input consists of multiple test cases. Each test case starts with a line containing one integers N (1 ≤ N ≤ 50), which is the number of illegal segments. The following N lines gives N non-empty Strings of length not greater than 20 containing only lowercase, which are the illegal segments. The last line of the test case is a non-empty string of length not greater than 500 containing lowercase, which is the String to be repaired.

Output

For each test case, print a line containing the test case number( beginning with 1) followed by the number of characters which need to be changed.

Sample

Input

2
abv
dh
abvdhf
2
abc
bcd
abcde

Output

Case 1: 2
Case 2: 1

Source: z_y


Comments

There are no comments at the moment.